This is the mail archive of the
mailing list for the pthreas-win32 project.
Re: Buggy conditions
- To: firstname.lastname@example.org
- Subject: Re: Buggy conditions
- From: Todd Owen <email@example.com>
- Date: Fri, 25 Jun 1999 20:57:51 +0800
At 06:53 PM 6/23/99 +0200, you wrote:
>One question more: What happens, if thread waits on semaphore object, wakes up
>after timeout and then another (broadcasting) thread posts the semaphore? Probably
>another thread will spuriously wake up next time, nothing more. Can someone tell
>his/her opinion to this?
As I understand it, that's the expected behaviour for a semaphore - if the semaphore value is greater than 0, wait()s will complete immediately. So unlike condition variables, semaphores can "count", which sometimes makes them useful (such as in the old producer-consumer problem).
....................please cut here....................
Todd Owen <firstname.lastname@example.org>
=== Netway Technologies ===