I've now encountered this issue several times, where I reach a frozen strategy state with "waiting on lock owned by Thread <#>" when calling ChangeOrder() on an order (see attached screenshot). Note in the screenshot example that ChangeOrder() is being called from OnOrderUpdate() - though I'm not sure that this fact is relevant to the issue. The strategy is Unmanaged. I'm not doing any custom locking (such as locking on the SC or CbiOrder objects) that would cause this. Seemingly, NT is doing some internal ReaderWriterLockSlim locking (see screenshot) that is hanging up. I wish I could provide some simple test code for reproducing but the issue is rare - though again, I've now encountered it several times during real-time Sim101 strategy testing over the last couple of months. I hope you can shed some light on the locking situation and how I can avoid this.
Thanks,
Josh
Comment