Atomicity of Cells
Raphael Collet
raph at info.ucl.ac.be
Wed Jan 19 08:45:23 CET 2005
David Hopwood wrote:
>
> Raphael Collet wrote:
> > Dear Christopher,
> >
> >>Exchange is atomic on cells, what about '@' and Cell.access? I am
> >
> > If C is a cell, then X=@C is the same as X={Access C}, which is the same
> > as {Exchange C X X}. There is only *one* stateful operation, so it is
> > atomic by definition.
>
> I don't mean to be pedantic, but the fact that there is only one visible
> operation doesn't necessarily mean that it is implemented in only one
> step. Your argument would also depend on the fact that steps are strictly
> interleaved, which is true of Oz but not some other concurrency models.
>
> Exchange operations are atomic, but that's a specified property of Exchange
> rather than being true by definition.
You're completely right. The atomicity of Exchange is guaranteed by the
definition of the language. This wouldn't be true if Exchange was
defined by
proc {Exchange C Old New}
Old=@C
C:=New
end
Cheers,
raph
More information about the mozart-users
mailing list