Re: [Quickfix-developers] SocketAcceptor::onPoll()
Brought to you by:
orenmnero
From: Mark T. K. <mke...@di...> - 2009-03-04 20:43:37
|
just out of curiosity, do you see any of the code from the attached patch in your source tree? it fixes at least one deadlock problem. /mark Peter Piper wrote: > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > > ------------------------------------------------------------------------ > > Hi, > > I'm investigating a deadlock somewhere in my application that uses > Quickfix, so I am squirreling through the source looking for likely > culprits. The onPoll() member seems oddly constructed to me (source > copied below). > > In particular: > > 1. Why have the test for start = 0, as it will always be zero at that > point? (Not going to ask why those variables declared outside the if() > scope!) > > 2. Why is start (an automatic and therefore local variable) reset to > zero before the function returns and destroys it anyway? > > I looked at an earlier copy of quickfix (also confusingly called version > 1.12.4) and the start variable does not exist at all in that version, so > I'm confused as to why it should have ended up looking this messy? > > Anyone else think this is odd or am I having a bad hair day? > > Yours, > > Dan > > ----- code from Subversion repository version 1.12.4 as of 11 FEB 2009 ----- > > bool SocketAcceptor::onPoll( double timeout ) > { QF_STACK_PUSH(SocketAcceptor::onPoll) > > if( !m_pServer ) > return false; > > time_t start = 0; > time_t now = 0; > > if( isStopped() ) > { > if( start == 0 ) > ::time( &start ); > if( !isLoggedOn() ) > { > start = 0; > return false; > } > if( ::time(&now) - 5 >= start ) > { > start = 0; > return false; > } > } > > m_pServer->block( *this, true, timeout ); > return true; > > QF_STACK_POP > } > > > ------------------------------------------------------------------------ > Windows Live Hotmail just got better. Find out more! > <http://clk.atdmt.com/UKM/go/134665311/direct/01/> > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > > > ------------------------------------------------------------------------ > > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers This communication and any attachments may contain confidential/proprietary information and is intended for information purposes only. It is not an invitation or offer to purchase interests from Diamondback. Any representation to the contrary is unintentional. This communication is intended only for the person(s) to whom it is addressed. If you are not the intended recipient you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message or any attachments is not permitted. If you have received this in error, please notify the sender immediately by e-mail and delete this message. All e-mails sent to or received from this address will be received by Diamondback's company e-mail system and is subject to archival and possible review by someone other than the recipient. This notice is automatically appended to each e-mail message leaving Diamondback. |