develooper Front page | perl.perl6.language | Postings from January 2001

Re: JWZ on s/Java/Perl/

From:
David Mitchell
Date:
January 30, 2001 08:07
Subject:
Re: JWZ on s/Java/Perl/
Message ID:
200101301607.QAA12709@tiree.fdgroup.co.uk
"Branden" <branden_p6@hotmail.com> wrote:
> The thing with mandatory locks per variable, is that as long as you only
> want to access _that_ variable, it's ok, but if you want to make several
> uses of several variables and want to do it all at once, you've got a
> problem.

[ big snip ]

Sorry, I misunderstood you. I think in fact we agree! What I was
advocating was that Perl should automatically make accesses to
individual shared variables safe, so 2 threads executing
1: $shared = 10;  2: $shared = 20;

wont guarantee whether $shared ends up as 10 or 20, but will guarantee
that the internal representation of $shared wont get corrupted.
Anything that guarantees consistency between multiple variable accesses
should be up to the programmer to decide where to lock, IMHO.




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About