From: Michael Glassford (glassfordm_at_[hidden])
Date: 2004-06-30 10:57:31
Batov, Vladimir wrote:
>>>" Thread-safety should not be a run-time configurable property."
>>I think this is somewhat incorrect as absolutes usually are.
> Well, I'll probably lose the fairly abstract discussion of general
> incorrectness of absolutes. :-) I just think that compile-time vs.
> run-time is a pragmatic choice. Why give the user an alternative with is
> dubious and likely incorrect? For that reason std::list does not provide
> operator even though it could. Surely, one could come up with his/her
> design that would "require" such an operator for std::list. Does it
> invalidate the decisions STL designers made? I do not think so.
> That is why I am suspicious of temptations to lump distinctly different
> functions of scoped_lock, try_lock and timed_lock into one universal
Well, as you point out, try_lock is like a timed_lock with time = 0,
and lock is like a timed_lock with time = infinity, so why not give
timed_lock both lock() and try_lock() methods as shorthand notation for
lock(m, t=0) and lock(m, t=infinity)?
The argument for try_lock not having a blocking lock() method, which you
seem to stress more often, is much clearer; I'm much more inclined to
agree with you there.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk