Re: [Quickfix-developers] Faster logons
Brought to you by:
orenmnero
|
From: Dale W. <wil...@oc...> - 2005-11-03 19:05:24
|
Oren Miller wrote: > We actually do have a cross platform Event object that should do the > trick with a little modification: > http://cvs.sourceforge.net/viewcvs.py/quickfix/quickfix/src/C%2B%2B/Event.h?rev=1.4&view=markup > <http://cvs.sourceforge.net/viewcvs.py/quickfix/quickfix/src/C%2B%2B/Event.h?rev=1.4&view=markup> Cool. You're ahead of us. And in that case, I second Brian's suggestion about sleeping with a timeout. The session::login process could nudge the sleeping thread to say "Hey, look what I just did!" Dale > > It uses WaitForSingleObject and pthread_cond_timedwait. It is > hardcoded to wait for 100 milliseconds. If we just add a wait() > signature where we can pass in a value for the time, this class would > probably be perfect. > > --oren > > ----- Original Message ----- > *From:* Dale Wilson <mailto:wil...@oc...> > *Cc:* qui...@li... > <mailto:qui...@li...> > *Sent:* Thursday, November 03, 2005 12:54 PM > *Subject:* Re: [Quickfix-developers] Faster logons > > Brian Erst wrote: > >><SNIP> >>I would also suggest that the use of process_sleep is a bad idea - >>whenever I need to code a sleep-type function, I use a mutex and a >>WaitForSingleObject with the sleep time as the timeout. That way, I can >>interrupt the sleep (by triggering the mutex) if the reason for the >>sleep has gone away (or so I don't have to wait 30 seconds to bring my >>application down if I'm sleeping). Makes things much more responsive. >> >> > An excellent idea with one very important drawback. > WaitForSingleObject with a timeout is a WIN32 concept. > It is possible, but not necessarily easy, to code an equivalent > functionality on a posix system using |pthread_cond_timedwait. > If QuickFIX were going to use this technique someone would have to > beef up its cross-platform thread synchronization support. > > Dale > > | > >>- Brian Erst >>Thynk Software, Inc. >> >> >> >> > -- > >----------------------------------------------------- > Dale Wilson, Senior Software Engineer > Object Computing, Inc. (OCI) > http://www.ociweb.com/ http://www.theaceorb.com/ >---------------------------------------------------- > -- ----------------------------------------------------- Dale Wilson, Senior Software Engineer Object Computing, Inc. (OCI) http://www.ociweb.com/ http://www.theaceorb.com/ ---------------------------------------------------- |