Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-03-15 14:53:12


--- In boost_at_y..., terekhov_at_y... wrote:
> --- In boost_at_y..., williamkempf_at_h... wrote:
> the checks are only needed (if at all) in debug mode.
> POSIX threads standard (and coming SUS) does have recursive mutex.

OK, POSIX defines three attributes that deal with this:
PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_ERRORCHECK and
PTHREAD_MUTEX_RECURSIVE. I'm still trying to determine if these
types are universally acceptable or if there will be implementations
that don't support some of the options here. If they were
universally available it might help to simplify some things.
Unfortunately, it won't help with the boost::recursive_mutex. It
seems that the recursive mutex is not recommended for use with
condtion variables "because the implicit unlock performed for a
pthread_cond_wait() or pthread_cond_timedwait() will not actually
release the mutex (if it had been locked multiple times)." The
Boost.Threads implementation deals with this and allows for proper
usage.

If there's a pthreads expert that wants to tackle the issue of the
implementation here I'd be more than willing to work with them to
resolve this.

Bill Kempf


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