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

Re: JWZ on s/Java/Perl/

Thread Previous | Thread Next
David Mitchell
January 30, 2001 08:07
Re: JWZ on s/Java/Perl/
Message ID:
"Branden" <> 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.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About