condition wakeup behaviour
Stephen Hemminger <[email protected]>
| Newsgroups | gmane.linux.ngpt.devel |
|---|---|
| Message-ID | <1021330267.32725.9.camel@dell_ss3.pdx.osdl.net> |
I am running a comparision test with one driver thread and lots of worker threads; and seeing some surprising behaviour. When I run with old style linux pthreads, the test scales badly as the number of threads increase (this is expected); the same behaviour happens on SMP systems and with different linux kernel schedulers. When I run the test with NGPT the test scales well on a 1 cpu system, but seems to pause when running on an 8-way system. I am running a patched 2.4.18 kernel with NGPT 1.2.2 Perhaps the problem is in the pthread_cond_signal (pth_cond_notify) since it just makes the condition change state then starts yielding to all the threads. Wouldn't it be better to keep some state in the condition variable that points to the thread on the "top of the waiting queue" and yield directly to that thread?