Boost logo

Boost :

From: Keith Burton (kb_at_[hidden])
Date: 2002-05-18 03:25:53


Part of original reply by Bill Kempf

If you know the rules of move semantics this isn't a case where you'd
lose the lock but didn't expect to. The problem is, as with auto_ptr,
newbies don't understand the rules of move semantics so *they* are
surprised. So, yes, I agree this is a major drawback to this solution,
and that's precisely why I asked for RFC on it. Are the dangers worse
then the dangers present with exposed lock/unlock methods? What if the
move semantics used syntax that made it more appearant what was going on
(such as the proxy suggestion I made in another reply) to reduce
surprise for newbies?

Comment :

I agree with Pete Becker's comment that multi-threading is not for
newbies.
The problem with move semantics compared to exposed lock/unlock methods
is that current experts may become newbies.
Therefore one criterion by which a solution should be judged is, how
does one find one's mistake when one inevitably makes them.
That is when using a move semantics solution is there an equivalent to
"grep lock *.cpp" when one is desperate.

Keith


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