Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2001-05-22 14:35:56


At 12:22 PM 5/22/2001, williamkempf_at_[hidden] wrote:

>... One result of this factoring
>is that all the mutex types now have an unspecified locking policy,
>meaning attempts to recursively lock the mutex by a single thread
>will result in undefined behavior instead of in lock_error exceptions.

Seems like a reduction in safety. Is it costly to continue to throw
lock_error exceptions?

>I'm most interested in opinions about the factoring of mutex. If
>this sounds like a good idea then we should also factor out
>recursive_mutex in the same manner.

OK with me, but I'm not a threading expert. Seems a bit clearer than one
mutex types with three lock types.

> I'm a tad concerned with the
>length of names produced by this, though: recursive_mutex,
>recursive_try_mutex and recursive_timed_mutex.

They don't seem that long to me. And better that the more abbreviated
suggestions.

By the way, I have now used Boost.threads in one test program (with Jens'
bounded queue) and one real application. Very good results with both.

The one need that keeps coming up is thread-safe counter known to hold at
least 32 bits.

--Beman


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