Boost logo

Boost :

From: Kevin S. Van Horn (kevin.vanhorn_at_[hidden])
Date: 2001-10-17 12:59:13


On Wed, 17 Oct 2001 williamkempf_at_[hidden] wrote:

> --- In boost_at_y..., kevin_vanhorn_at_n... wrote:
> > > I just noticed, to my dismay, that the thread library only
> > > implements weak semaphores.
>
> Not precisely true. The Win32 implementation isn't a "weak"
> implementation. The POSIX one may well be, however. I'll
> investigate.

Regardless of how it is resolved, I think the documentation needs to
discuss the issue of weak vs. strong vs. fair semaphores, and make it clear
which you are getting.

The issue of fair vs. unfair also shows up in discussing mutexes. The default
"Unspecified" policy guarantees too little; the (unimplemented) "FIFO" policy
guarantees too much. It would be useful to define and implement a mutex with a
"Fair" scheduling policy, which guarantees lack of starvation but does not
guarantee a particular scheduling order nor a particular bound on how many
other threads can lock the mutex before any specific thread gets its turn.

I'm not sure whether or not POSIX mutexes are guaranteed to be fair in the
above sense.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk