Boost logo

Threads-Devel :

From: Matt Hurd (matt.hurd_at_[hidden])
Date: 2006-03-01 11:21:58


> Hi all,
<snip>

An additional discussion point is the recursive / non-recursive default
thingo.

I like the current boost default of a boost::mutex being the base level an
platform supports, but this has bitten me big time in projects. Especially
with windows developers coming to a posix platform.

Posix, and thus linux, are non-recursive by default. Windows mutexes are
re-entrant.

I'm no longer so sure the boost default is such a good idea especially as the
performance of a recursive mutex on posix on a modern platform seems
consistent with a non-recursive one in the main...

I think having the recursive mutex as a consisent default across platforms
will be a good thing and protect the average user, like me, from themselves.

Have a concept of a non-recursive mutex as a special case mutex raises an
interesting point as on windows they don't exist, so the separate concept as
a
lowest_level_mutex_that_may_be_recursive_or_non_recursive_depending_on_your_platform
which is the boost default remains useful.

Any thoughts on this?

Regards,

Matt.


Threads-Devel list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk