Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-07-18 13:26:49

--- In boost_at_y..., Jeremy Siek <jsiek_at_r...> wrote:
> On Wed, 18 Jul 2001 williamkempf_at_h... wrote:
> > 1) I don't find it to be so awful.
> > 2) I'd prefer to choose a different name for spinlock.
> But "spinlock" is the name everyone uses.

That does not mean it's the right name, though ;). So long as we
have a "lock" concept (and I still think this to be the best name for
such a concept) then a "spinlock" should have a different name.
After all, the "spinlock" is really just a refinement on the Mutex
concept, and should be named accordingly.

> > 3) I doubt we add a spinlock to Boost.Threads any way.
> Really? Spinlocks may not be good general purpose mutexes, but
there are
> lots of situations where they are the right choice. I think that
> should definitely be in Boost.Threads. If we don't put them in, then
> people will just create there own... I think it's better to have a
> standard version.

Spin locks are inherantly non-portable (on some platforms I'd expect
it to be impossible to have a spinlock for the same reasons that
atomic_t is difficult to implement, only that the ways to work around
it will result in something that's not truly a spinlock any way).
More importantly, code that makes use of a spin lock is not likely to
be in code that's portable, since most portable code will be better
served by a mutex.

Bill Kempf

Boost list run by bdawes at, gregod at, cpdaniel at, john at