[Pharo-project] [squeak-dev] Re: How about atomic value-swap bytecode?

Ralph Boland rpboland at gmail.com
Thu Oct 14 09:36:20 EDT 2010

>> ...

> I don't get the "dependency from scheduling nuances part", but here's my
> idea:

> Add the compiler changes to support :=: as atomic swap. We don't really
> need a bytecode for now, since a sequence of assignments is currently
> atomic. So the compiler could compile :=: as three assignments using a
> hidden temporary variable. On other systems, :=: can be compiled
> differently.

> Levente

What does:
       a :=: b :=: c.

Perhaps anybody who does this should be shot but it must be
well defined in the language (or at least defined as a syntax error)
and of course the compiler must know what to do.

How about it meaning:

| tmp "hidden" |
tmp := a.
a := b.
b := c.
c := tmp.  ?

And if supported in the VM it should of course be atomic.

Ralph Boland

P.S.  What does
              a := b :=: c.

More information about the Pharo-dev mailing list