|
Boost Users : |
From: Zeljko Vrba (zvrba_at_[hidden])
Date: 2007-11-28 01:51:50
On Tue, Nov 27, 2007 at 08:25:27PM +0100, Lars Hagström wrote:
>
> Hmm, I've been thinking about this a little bit more, and I've more and
> more started to like the idea (not for its beauty, but more for its
> practicality)...
>
I think this approach is a bad idea. Even if the application itself
does not hold the mutex for a long time (measured in CPU time), it may
be preempted and/or stopped for arbitrary amounts of time (eg. think
swapping). If this happens after it has acquired a mutex, then this
scheme will break.
>
> Lars Hagström wrote:
> >
> > Of course this assumes that locks are never held for "a long time", and
> > is quite easily considered a horrible solution... But it may well work
> > in many situations.
> >
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net