On Mon, Oct 12, 2015 at 3:20 PM, Thierry Goubier <thierry.goubier@gmail.com> wrote:
Hi Sebastià n,
2015-10-12 13:53 GMT+02:00 Sebastián Krynski <skrynski@gmail.com>:
Hello my name is Sebastián Krynski from Buenos Aires, Argentina. Just writing to let you know that I'm starting to work on adding an atomic swap operator in Pharo , guaranteed not to be interrupted by the VM. The operator will be used this way:
a :=: b
meaning 'swap variable a with variable b'.
Why a cryptic, special syntax? The compiler could inline an explicit message send which would make the intent clear.
See previous discussions about <=> indeed.
a atomicSwapWith: b.
Well, anyway, the compiler has to do something special there.
Could we have something like...
[ | temp | temp := a. a := b. b := a ] atomic
? Would a compiler be able to merge that in a swap instruction? And make another type of processing for a different code inside the block?
We have Mutex>>critical: aBlock etc. Why not Atomic>>do: aBlock ? Would indeed be more readable than :=: Phil
In order to do this I will be modifying the VM and the Compiler .
Good luck. This is an important step.
I'm working under the direction of INRIA and Gabriela Arévalo.
Welcome!
Thierry