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

Re: JWZ on s/Java/Perl/

From:
Branden
Date:
January 30, 2001 08:21
Subject:
Re: JWZ on s/Java/Perl/
Message ID:
OE31oYAPNXRPmcarcR40000403a@hotmail.com
David Mitchell wrote:
> 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.
> 


Sorry, because I think _I_ misunderstood you the first time.

I'm glad we agree. This remark of yours is exactly the point where
I wanted to get with my post. Perl only takes care of concurrent
access to the internal structures of *non-local* variables. This
will probably be piece-of-cake by having specialized vtables that
are present only in *non-local* variables, and take care of holding
some locks for every operation that is made against that variable.
This way shared data structures get protected.

- Branden




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