{{Quickfixn}} Placing a lock on Session.SendToTarget
Amar Parmar
amar.parmar at octave-im.com
Fri Oct 10 09:50:08 PDT 2014
Hi,
I had a bug today where a timer call back and a sequential processer both sent the same order (same tag 11).
This happened because the callback identified the order as to be sent before the sequential handler had updated the status of the order as sent. This would rarely happen, but did occur.
My thought was to place a lock around the portion of code that; checks if an order is to be sent, sends it and marks it as sent:
lock (sendLock)
{
if (!dictionaryMaps.isWorking[order])
{
fixOrder.TransactTime = new TransactTime(DateTime.UtcNow, true);
Session.SendToTarget(fixOrder, Globals.sessionID);
dictionaryMaps.isWorking[order] = true;
}
}
I believe this would solve by issue, but I am worried that there maybe unintended consequence to placing a lock around the SendToTarget method.
Does anyone see any issues?
Thanks,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20141010/23832185/attachment-0001.htm>
More information about the Quickfixn
mailing list