thread overhead performance

view story

http://stackoverflow.com – When programming in C using threads, in a Linux shell, I am trying to reduce the thread overhead, basically lower CPU time (and making it more efficient). Now in the program lots of threads are being created and need to do a job before it terminates. Only one thread can do the job at the same time because of mutual exclusion. I know how long a thread will take to complete a job before it starts Other threads have to wait while there is a thread doing that job. The way they check if they can do the job is if a condition variable is met. For waiting threads, if they wait using that conditio (HowTos)