Parallel programming under 5ms

Hi,
How can i obtain the parallel processing with thread using 5ms each.

Hi have 4 threads each one sets on a cpu with max priority, each thread use 5ms of processing, the threads are sinchronized with semaphore or pthread_join:


gettime(t0)
for(i <5)
{
create_thread
{
for(i<5)
{
pthread_join
}
gettime(t1)
time = t1 - t0

each thread use 5 ms of processing, but the time of the execution of all threads is 20ms.
I think the problem is the kernel scheduling time, but i don’t know how i can change it.

Please can anyone help me?

thanks

Hello,
Without answering your question directly which probably can’t with the little information you’ve given, parallel processing performance is why I’m currently investigating CUDA.

Take a look at it, the basic concept is nearly “infinite” (in a practical sense, of course there are real limits) parallel processing all automatically managed for you. Code is run on the GPU instead of the CPU, processes are run in virtualized threads which effectively avoids the restrictions of pipelining and scheduling in a physical CPU.

Tony