Boost logo

Boost :

From: John Maddock (John_Maddock_at_[hidden])
Date: 2001-09-11 05:37:21


>Coincidence and the happy circumstance that POSIX is very well
>thought out. However, I'm not sure I agree with POSIX in this
>particular case. Counting semaphores are useful for limiting access
>to a resource to a specified number of threads. With out being able
>to set a maximum value it's very possible to accidently increment the
>semaphore value more times then you should have, resulting in an
>error whereby too many threads are allowed access. Defining the
>maximum shouldn't be a terribly burdensome requirement on the
>implementation, and it definately illiminates some sources of error.

OK.

>I've seen several "portable" threading libraries that seem unaware of
>this. Like I said, I'm not a POSIX expert. If someone can replace
>the hard coded definitions with POSIX sanctioned ones, even if they
>aren't 100% portable because of flawed implementations, then I'm all
>for them doing so. I just don't have the knowledge to do this.

Unfortunately, just because the feature test is available it doesn't
necessarily mean that the implementation advertises the feature - sometimes
because the feature was introduced before the standard which introduced the
feature test - so you still need a boost macro - it's just than you can
boilerplate when it gets set for most (but not all) cases.

- John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/


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