[ts-gen] MacOS Shim problems - the orders problem
Bill Pippin
pippin at owlriver.net
Tue May 26 17:07:17 EDT 2009
Paul,
Impressive results in debugging, especially if you are doing this
black-box:
> 1) Adding small delays between each command sent to the shim (by
> exs/risk.rb) seems to restore normal functionality. e.g.
> . . .
> print src3, src4, open, skip;
> Shim.print src3; sleep 0.01 # <---
> Shim.print src4; sleep 0.01 # <---
> Shim.print open; sleep 0.01
> Shim.print skip; sleep 2
Thanks much, Paul, for saving me a fair amount of effort searching for
the problem. Your report is much appreciated.
Clearly you've found a sequencing problem in the shim in the order
with which side-effects are performed, such that the problem is
hidden when commands are single-stepped, almost like a race-condition,
if it's approproriate to use that term for singly-threaded code.
Based on design knowledge, I can explain as follows:
The actions for internal commands, including bind, have been
implemented via an exec() method, while send commands, that is
those that map to some request, occur mostly through grammar
actions, with only the actual map2() operation to build the
request object being controlled by Router processing.
Unfortunately, with command parsing now in a loop for all reads
before the follow-on Router processing of events, the side effect
from a variable binding is not being completed before the binding
is needed for a following order command.
Although the implementation of the other internal command ops
via Router processing is appropriate, variable bindings including
orders should be performed by grammar actions as for send command
actions. So, the solution to the problem you've uncovered is
to change the Bind.exec() operation to a nop, and implement
that action instead via an attribute grammar symbol.
I expect to have another release with this change out tomorrow,
that is Wednesday.
Thanks,
Bill
More information about the ts-general
mailing list