> But for a single 'statement', it may be possible to gather all the
> objects needing a lock and then grabbing them in order (say by address).

I still don't buy that.  In Perl even simple assignments and
increments are not atomic which means that even 'single statements'
would require locking and unlocking of a pile of data structures,
leaving plenty of room to both inconsistencies and deadlocks.
 
> This would keep a _single_ statment 'consistent'. But wouldn't do anything
> for anything more complex.

Why bother, then?

Multithreaded programming is hard and for a given program the only
person truly knowing how to keep the data consistent and threads not
strangling each other is the programmer.  Perl shouldn't try to be too
helpful and get in the way.  Just give user the bare minimum, the
basic synchronization primitives, and plenty of advice.

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Reply via email to