It looks like each wait using this method consumes like 0.5-0.7% of CPU.
To me it's a lot of CPU, when waiting in like 8 threads (doing nothing) the app uses like 4-5% of CPU!
Can I do anything about it?
See this youtube video (at 1080p), process name "ufbio".
The relevant waiting code for each thread's cond_wait:
Code:
while(hints.bits & UFB_BIT_PAUSED) {
L;
status = pthread_cond_wait(&hints.cond, &hints.mutex);//HERE each thread waits
L;
if(status != 0) {
ufbErr(status);
}
if(hints.bits & UFB_BIT_CANCELLED) {
break;
}
}
"L;" prints "PING" plus the current line and function, like "PING {253}{ioCopy}", it shows up in the video in the terminal to prove the threads are doing nothing else.
Bookmarks