Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-09-07 04:51:44


From: "William Kempf" <williamkempf_at_[hidden]>
> From: "Peter Dimov" <pdimov_at_[hidden]>
> >BTW why doesn't boost::mutex use a critical section on win32?
>
> To avoid having to either include the windows headers in mutex.hpp or
> require dynamic allocation internally. During development I was provided
> with research that showed that critical sections often actually result in
> worse performance than mutexes (surprised me), so it was easier just to
> implement using a Win32 mutex.

Yes, I see the point now. However this will be, I think, unacceptable to the
performance freak types, who will gladly pay the price of #include
<windows.h> (because they are likely to need it anyway) in return for the
increased performance.

I'll be interested in your research. MS people that know the details claim
that a critical section is incredibly optimized and should beat a mutex in
any reasonable scenario.

--
Peter Dimov
Multi Media Ltd.

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