Re: [Quickfix-developers] Faster logons
Brought to you by:
orenmnero
|
From: Brian E. <azz...@ya...> - 2005-11-03 19:11:03
|
Well, then, just ignore my last message. Sounds like a tweaked Event object will do the trick perfectly! - Brian Erst --- Oren Miller <or...@qu...> 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 > > 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 > Cc: 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/ > ---------------------------------------------------- |