Boost logo

Threads-Devel :

From: Matt Hurd (matt.hurd_at_[hidden])
Date: 2006-03-01 13:48:02


On Thursday 02 March 2006 04:50, Anthony Williams wrote:
> Matt Hurd <matt.hurd_at_[hidden]> writes:
> >> > Any thoughts on this?
> >>
> >> Well, OS Mutexes might be recursive on Windows, but Critical Sections
> >> aren't.
> >
> > Huh? I haven't programmed on windows for a bit but I'm pretty sure they
> > are:
>
> I must be going mad. Of course, you're right.
>
> Anyway, my basic_mutex does not allow recursive locks --- you need
> basic_recursive_mutex for that.

OK.

Then what is the advantage over wrapping a critical section up as the mutex /
locking mechanism? It is fast, native to windows and recursive. And,
perhaps more importantly, written and maintained by someone else ;-) The
timings I did a few years ago suggested to me (from memory) that the cycle
count on a windoze critical section wasn't much more than an atomic op.

matt.

> Anthony


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