[ts-gen] MacOS Shim problems - the orders problem

Paul C paulq2o0 at yahoo.co.uk
Mon May 25 07:08:12 EDT 2009


Bill,

A couple of observations that may give a clue about the Orders
problem (incidently the shim seemed to start up in risk mode as
normal):

> Unfortunately, the release earlier today breaks orders, and it's
> not clear at this moment where the problem is.  

I've found two ways of getting orders to work again. Probably neither
is the solution, but maybe it will help reveal the problem:

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

    etc, for all statements including the 'bind' commands

2) Setting the shim to no-buffering on STDIN by (experimentally) adding 
setvbuf(stdin,NULL,_IONBF,0) to the shim source code (rather arbitrarily
I put it before the 'while' statement in src/shim.c).  Note, that's
IONBF, not IOLBF, which didn't seem to help matters.

Either of the above makes exs/risk.rb (and variations) behave
normally, with orders being created, modified, cancelled and/or submitted to tws as
before.  (Maybe the ruby sleep command causes the OS to flush the buffer?)
 

> I've pushed a new
> tarball over the earlier one of today that disables risk mode, so
> that it will be obvious to users who download it that it can not
> be used to submit orders.

The above experiments were with the last available shim-090522.tgz
timestamp 23:28:00 [GMT perhaps], which seemed to start in risk mode as normal; hopefully
there if no significance to that. (Without either of the above changes
the shim gives errors beginning 'Problem: 442 bind order var to
template before ordering'....)

PS:  I've just tried a single "sleep 0.01" between the two 'bind'
statements in risk.rb, and that seems to be sufficient.
I hope something in there is helpful.

Regards

Paul


More information about the ts-general mailing list