Hi all, we have a production trading system we're thinking about porting to Lean from another platform and I have a few questions about threading -- I hope this is the right place for it.

1. Does Lean serialize calls to my OnData() method? In other words, if my method ran forever would I get another call to OnData (at the next slice) on a different thread, or would I just get no further calls to OnData()?

2. Assuming the answer to #1 is yes, if I start background tasks from OnData() on a other threads, can those threads initiate orders independently without causing threading issues in Lean?

3. Similarly, are OnOrderEvent() serialized?  Or, if many orders were outstanding, would I expect to get overlapping OnOrderEvent() calls on different threads?

4. Is there any scenario involving threads that I should be careful to avoid?

Thanks so much for all the work on what looks like a great system --

David

Author