Re: condition wakeup behaviour
"Saurabh Desai" <[email protected]>
| Newsgroups | gmane.linux.ngpt.devel |
|---|---|
| Message-ID | <[email protected]> |
The pthread_cond_signal doesn't yield to all threads. It's the pthread_cond_broadcast that yields to all threads, means if broadcast flag is true in the pth_cond_notify. Do you have some sort ot test program to test this? - - - - - Saurabh Desai POSIX Threading for Linux IBM Linux Technology Center e-mail: [email protected] OR [email protected] phone: 512-838-2655, T/L: 678-2655 http://oss.software.ibm.com/developerworks/opensource/pthreads Stephen Hemminger <[email protected]>@www-124.southbury.usf.ibm.com on 05/13/2002 05:51:07 PM Sent by: [email protected] To: [email protected] cc: Subject: [pthreads-devel] condition wakeup behaviour 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? _______________________________________________ pthreads-devel mailing list [email protected] http://www-124.ibm.com/developerworks/oss/mailman/listinfo/pthreads-devel