Re: [Quickfix-users] SocketInitiator and SynchronizedApplication vs Application
Brought to you by:
orenmnero
From: Oren M. <or...@qu...> - 2006-08-18 15:03:26
|
First of all, messages on a single Session always come serially, no matter which threading model is used. It is required by the specification that messages be processed in sequential order. So while you are processing a message, under no circumstances will you receive another message from he same session until you return from the callback. This is true with any model no matter how you configure the engine. So if you are really just running one session, there is no need to synchronize anything. As for the SocketInitiator, all the IO is handled in a single thread. So with this model you will not receive any messages from any session managed by that initiator while in the callback. So again, no need to synchronize. (If you have multiple SocketInitiators, than you can continue to receive messages from their sessions as they are running on a different thread). This is why while running multiple sessions, messages should either be handled quickly, or delegated to another thread or process so QuickFIX can continue to receive messages. (If you are running just one session and must process the message sequentially, you can take your time in the callbacks). Since we moved to non-blocking sockets, there probably isn't a great case for using the ThreadedSocketInitiator with a SynchronizedApplication anymore. If you are going to do that I would just recommend using the SocketInitiator. You should really only use the ThreadedSocketInitiator if a significant portion of your processing can be done without shared resources. Otherwise, you are just adding the overhead of mutexes and thread swapping without any of the benefits of increased responsiveness or parallelism. --oren On Aug 18, 2006, at 8:27 AM, Mark T. Kennedy wrote: > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/ > html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > if i'm using a SocketInitiator (connecting to a single party) with a > SynchronizedApplication instance, then it is clear that if a callback > blocks, it will block all other callbacks. > > but if i'm using a SocketInitiator with a plain old Application > instance, what is the model? if a callback blocks, will it block > any other callback? e.g. is a single thread used to receive > messages and deliver the 'from' callbacks? > > /mark > > > ---------------------------------------------------------------------- > --- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Quickfix-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-users > |