<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">With all due respect, I can't really teach people about C# multi-threading on this list. I can only give a few pointers.</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">Please check out the BlockingCollection:</div><div class="gmail_default"><font color="#000000"><a href="https://docs.microsoft.com/en-us/dotnet/api/system.collections.concurrent.blockingcollection-1?view=netcore-3.1">https://docs.microsoft.com/en-us/dotnet/api/system.collections.concurrent.blockingcollection-1?view=netcore-3.1</a></font><br></div><div class="gmail_default"><font color="#000000">The default BlockingCollection implementation is a ConcurrentQueue, which is FIFO.</font></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">You will create a BlockingCollection<Message>. Your QF callbacks will Add() messages to this collection (on the QF thread). You need to create a separate worker thread that will call collection.Take() over and over again (if the collection is empty, it will block until something goes in there) and process the message.</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 16, 2020 at 7:20 AM YUTAKA YOSHIDA <<a href="mailto:ysdytk1973@gmail.com">ysdytk1973@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thank you for your response.<div><br></div><div>Could you provide me an example code?</div><div>I have tried in several ways but this issue remains unresolved.</div><div>I am attaching my quick fix log file.</div><div><br></div><div>Best regards,</div><div>Yutaka</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 15, 2020 at 11:16 PM Grant Birchmeier <<a href="mailto:gbirchmeier@connamara.com" target="_blank">gbirchmeier@connamara.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">My strong suspicion guess is that you are doing too much work within the OnMessage callback. (Or any callback, really, but probably OnMessage.)</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">For each message received, OnMessage(<type>) is called, and further message reception is blocked until OnMessage() returns. So if OnMessage takes too long, the queue eventually will back up and you will eventually see message loss.</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">A common technique is to have OnMessage push the message into a work queue and return instantly, while another thread consumes off the work queue and processing them.</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">Does that make sense?</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 15, 2020 at 6:09 AM YUTAKA YOSHIDA <<a href="mailto:ysdytk1973@gmail.com" target="_blank">ysdytk1973@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello everyone,<div><br></div><div>I am using Quickfixn for accessing LMAX.</div><div>I have a serious problem now.</div><div>During receiving the price updates from the server, logout/login repeats sometimes.</div><div>LMAX said like this.</div><div>///////////////////////////////////////////////////////</div><div><p class="MsoNormal">If your software gets overwhelmed it will return a TCP Window size=0, this means that you’re not able to receive further messages at the moment, and the TCP transmission is halted until it can process the messages in its receive buffer.</p><p class="MsoNormal">TCP back pressure will result when your software is unable to process the TCP packets fast enough (can't keep up) so messages start to back up on our side awaiting being sent. If your software gets overwhelmed it will return a TCP Window size = 0 which means that there is no room to send anything more at this time and messages queue up awaiting the next available window size.</p><p class="MsoNormal">We can try reducing the amount of updates we are sending to you (I can see your account is currently set as 1000 updates / sec with 20 levels depth market data) or you can reduce the number of instruments you are subscribing to. Please also contact you bridge provider to look at this issue.</p><p class="MsoNormal">//////////////////////////////////////////////////////////////</p><p class="MsoNormal">To solve this issue, I did the following steps.</p><p class="MsoNormal">-I upgraded VPS.</p><p class="MsoNormal">-I reduced the number of instruments to subscribe to.</p><p class="MsoNormal">-I commented on codes related to file writing.</p><p class="MsoNormal">However, this issue remains.</p><p class="MsoNormal">I have some errors in the FIX log file.</p><p class="MsoNormal">I am attaching it.</p><p class="MsoNormal">Can you help me now?</p><div><div><img>
</div></div><div>
<img>
</div></div></div>
_______________________________________________<br>
Quickfixn mailing list<br>
<a href="mailto:Quickfixn@lists.quickfixn.com" target="_blank">Quickfixn@lists.quickfixn.com</a><br>
<a href="http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com" rel="noreferrer" target="_blank">http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div><font size="2"><span style="background-color:rgb(0,0,0)"><span style="background-color:rgb(255,255,255)">Grant Birchmeier</span></span></font><font size="2"><font color="#3333ff"><br></font></font></div><div><font size="2"><b><font color="#3333ff"><span style="background-color:rgb(255,204,51)"><span style="background-color:rgb(255,204,102)"><span style="background-color:rgb(255,204,153)"><span style="background-color:rgb(255,255,255)"><span style="background-color:rgb(255,204,0)">Connamara Systems, LLC</span></span></span></span></span></font></b></font><br></div><div><font size="2"><b>Made-To-Measure Trading Solutions.</b></font></div><div><font size="2">Exactly what you need. No more. No less.</font><font size="2"><b><font color="#3333ff"><br></font></b></font></div><div><font size="2"><a href="http://connamara.com" target="_blank">http://connamara.com</a><br></font></div></div>
<br>
<span style="color:rgb(29,28,29);font-family:Slack-Lato,appleLogo,sans-serif;white-space:pre-wrap;background-color:white"><font size="2">This email, along with any attachments, is confidential. If you believe you received this message in error, please contact the sender immediately and delete all copies of the message. Thank you from Connamara Systems, LLC.</font></span>_______________________________________________<br>
Quickfixn mailing list<br>
<a href="mailto:Quickfixn@lists.quickfixn.com" target="_blank">Quickfixn@lists.quickfixn.com</a><br>
<a href="http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com" rel="noreferrer" target="_blank">http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com</a><br>
</blockquote></div>
_______________________________________________<br>
Quickfixn mailing list<br>
<a href="mailto:Quickfixn@lists.quickfixn.com" target="_blank">Quickfixn@lists.quickfixn.com</a><br>
<a href="http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com" rel="noreferrer" target="_blank">http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div><font size="2"><span style="background-color:rgb(0,0,0)"><span style="background-color:rgb(255,255,255)">Grant Birchmeier</span></span></font><font size="2"><font color="#3333ff"><br></font></font></div><div><font size="2"><b><font color="#3333ff"><span style="background-color:rgb(255,204,51)"><span style="background-color:rgb(255,204,102)"><span style="background-color:rgb(255,204,153)"><span style="background-color:rgb(255,255,255)"><span style="background-color:rgb(255,204,0)">Connamara Systems, LLC</span></span></span></span></span></font></b></font><br></div><div><font size="2"><b>Made-To-Measure Trading Solutions.</b></font></div><div><font size="2">Exactly what you need. No more. No less.</font><font size="2"><b><font color="#3333ff"><br></font></b></font></div><div><font size="2"><a href="http://connamara.com" target="_blank">http://connamara.com</a><br></font></div></div>
<br>
<span style="color:rgb(29,28,29);font-family:Slack-Lato,appleLogo,sans-serif;white-space:pre-wrap;background-color:white"><font size="2">This email, along with any attachments, is confidential. If you believe you received this message in error, please contact the sender immediately and delete all copies of the message. Thank you from Connamara Systems, LLC.</font></span>