Chris Rathman wrote:
Still trying to get my head wrapped around this. Stripping away all the
excess, I get down to the following:
local X L Script S in
thread {Delay 10000} L = nil end
Script = fun {$} L = nil end
S = {Space.new Script}
X = {Space.ask S}
{Browse X}
end
If I read this right, then Space.ask will not bind an external variable
- waiting in this case the 10 seconds until an ancestor thread does the
binding.
{Space.ask S} does not bind anything. It waits until it can determine
whether the space S is consistent or not. In the example, there is a
"speculative" binding on L. While L is globally unbound, it is not
possible to decide whether S is consistent. If L gets bound to 'foo' at
the toplevel, L=nil is inconsistent, and S must fail. If L=nil at the
toplevel, L=nil inside the space is consistent, and S succeeds.
Mozart gives a special status to those "speculative" bindings. They are
trailed inside the computation space where they occur. A space with
speculative bindings has no definitive status, unless its has failed
already. This way of determining a space's status is not subject to
race conditions. It is essential for a highly concurrent language like Oz.
Cheers,
raph
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users