Boost logo

Boost :

From: jsiek_at_[hidden]
Date: 2000-08-09 19:51:42


William Kempf writes:
> interface are specified. The "mutex" may not be a template, but the
> mutex concept is applicable to varying concrete types that may be
> used in templates. Do I have this right?

Yes, that is right.

> The documents look nice, and I like the approach taken for the
> try_lock. I'm still curious if a timed_lock should be considered.
> The benefit of a timed_lock over a try_lock is that the CPU
> utilization can be vastly reduced for some constructs on some
> platforms. Yes, that's starting to get specific to the
> implementation, which I don't want to do, but it still seems a valid
> question.

Yes, I think a timed lock deserves a place of its own. I'm not
sure whether it should just be added to the Mutex concept, or
do something like TimedMutex which is a Mutex with a timed lock.

> The only comment I'd make on the docs as written at this time is that
> the destructors may need a precondition. It's possilbe (though
> probably not desirable) to create the lock on the heap and pass it to
> another thread which deletes it. This means a thread is attempting
> to remove a lock that it doesn't own, which probably should be an
> error?

So what exactly should the precondition be? (sorry for being dense)

Cheers,

Jeremy


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