Re: [Quickfix-developers] Faster logons
Brought to you by:
orenmnero
|
From: Oren M. <or...@qu...> - 2005-11-03 19:00:39
|
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=3D1.4&view=3Dmarkup 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 -----=20 From: Dale Wilson=20 Cc: qui...@li...=20 Sent: Thursday, November 03, 2005 12:54 PM Subject: Re: [Quickfix-developers] Faster logons Brian Erst wrote:=20 <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.=20 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. --=20 ----------------------------------------------------- Dale Wilson, Senior Software Engineer Object Computing, Inc. (OCI) http://www.ociweb.com/ http://www.theaceorb.com/ ---------------------------------------------------- |