Boost logo

Boost :

From: Mark Rodgers (mark.rodgers_at_[hidden])
Date: 2000-08-10 14:07:52


From: "Kevlin Henney" <kevlin_at_[hidden]>

> I'm not sure I'm with you: I think categories and traits may find their
> way in, but from what I can see, most uses are, err, not useful. Locking
> tends not to have the same kind of genericity and flexibility as
> algorithms and iterators, ie we have many algorithms in the world but
> there are only a few rational locking policies.
>
> Can I just clarify, is the nested lock type just a tag? In other words,
> does nothing else?

The category is just a tag, but the mutex::lock would be the normal
scoped guard object. I was thinking more in terms of algorithms or
function that might change depending on what you can do with the lock.

For example, if you need to wait a time for the lock, you could do
that directly with a TimedLock, but would need a loop and sleeps for
a TryLock.

So just as std::distance does very little for a random access iterator
but more work for bidirectional iterator, so a waitfor function could
be a thin wrapper on a TimedLock but something more elaborate for a
TryLock.

But maybe that's the only example...

Mark


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