develooper Front page | perl.perl6.language | Postings from May 2006

RE: Synchronized / Thread syntax in Perl 6

Thread Previous | Thread Next
John Drago
May 31, 2006 16:41
RE: Synchronized / Thread syntax in Perl 6
Message ID:
James Mastros wrote:

> I don't like the name synchronized -- it implies that multiple things are
> happening at the same time, as in synchronized swiming, which is exactly the
> opposite of what should be implied.  "Serialized" would be a nice name,
> except it implies serializing to a serial format, like disk.  "Locked" is
> the best name I can think of, and it frankly isn't that good -- it's so
> vauge as to be able to mean almost anything.
> (Also, of course, all those /z/ names should have a s/z/s/ version, for
> those who speak a z-impared dialect of English.)
>       -=- James Mastros

Agreed - maybe "is serial" instead, which suggests "is parallel" would be its implicit counterpart.

If we have a situation that looks like this:

our method TakesForever ( int $num is serial ) is async {
  # Do something that takes a long time...then:
  # $num has not been changed by anything else that might
  # have access to $num.

my $age = 27;
TakesForever( $age );
$age += 20; # Fails somehow, because &TakesForever is working on $num

Maybe a better example is needed - this one is pretty contrived.

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