I have a program that should get the most out of my processor.
It is multithreaded through pthreads, which do their job perfectly, except that they "only" get my kernels up to about 60% of the load, which, in my opinion, is not enough.
I'm looking for a reason and I ask myself (and thereby you) if the mutex_lock / cond_wait blocking functions are candidates?
What happens when a thread cannot work in such a function?
- Does pthread switch to another thread that it processes, or
- Does the thread pass its time to the system, and if so, can I change this behavior?
Hi,
Nobody
Additional information A parameter is one mainthread that fills the taskpool and the countless number of workers who select jobs from there and wait for a conditional signal that is signaled by broadcast when serialized calculation is performed. They continue with the values ββfrom this calculation until they are completed, deliver mail and get the next job ...
source share