Re: [Quickfix-developers] Server Thread
Brought to you by:
orenmnero
From: Oren M. <ore...@ya...> - 2003-03-24 22:53:30
|
Yeah. This behavior is probably going to change soon. QuickFIX was originally designed with a certain type of application in mind, and is very good for quickly building thos kinds of applications (event based servers). More and more people are using it for other things, so a better approach is needed. Here is how it currently works. When you call start(), the acceptor or initiator will use the current thread to drive the socket events, and then spawns a new thread to call onRun. In retrospect, doing it the other way around probably would have made more sense. The original intent was that the start() thread would drive the fix engine (or spawn off a series of threads to drive it), and the onRun thread would drive non-FIX related events. Unfortunately, in the context of a larger application (such as GUIs), this is rather constrictive and forces you to do some architectural workarounds. The way that I want it to work is to get rid of the entire onRun concept, and make start() and asynchronous call. Then we could also provide a symetrical stop() call. I was planning on putting this into the 1.5 release. I'm debating whether to change over, or have a version that supports the new and old systems, and marking the old onRun as deprecated. Rob Kulseth <ro...@ri...> wrote:I am creating a GUI application to forward orders to a counterparty, from another counterparty. Everything is working fine, I just have one question. My application creates both an Acceptor and an Initiator. I noticed that when I tried to start the Acceptor with Acceptor.start() my application would hang. I soon realized that the start method claims the thread you use to call the method. To fix that I spawned another thread to invoke the start method. my GUI began to behave properly, but the thread that began looping in the onRun was not the same thread that I used to invoke the start method. Am I missing some basic concept here, or is this how it is supposed to work. I just don't want random threads laying around doing nothing. ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Quickfix-developers mailing list Qui...@li... https://lists.sourceforge.net/lists/listinfo/quickfix-developers --------------------------------- Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! |