[Quickfix-developers] Calling user code in quickfix thread
Brought to you by:
orenmnero
|
From: Sridhar V. <sva...@li...> - 2007-03-26 14:37:11
|
Hello, We are using the C++ (1.10.2) version of quickfix to implement an application which has a fix connection and another messaging connection. We have a few questions related to quickfix spawning its own thread and calling all callbacks in the context of the thread it spawned.=20 1. Is it possible to call a user defined callback periodically in the QF thread, so we can do all other non QF related processing in this thread itself, for example process messages from our messaging connection, etc? 2. If we were to push all fix messages received in the callback onto a queue, and do all processing on a different thread, then we run the risk that if the process is bounced then messages in the queue are lost, since from QF perspective the message has been processed since the callback exited successfully, while infact its still queued to be processed on a different thread.=20 While there are ways outside of QF to get around this, we were wondering if there was a way we could reliably modify the persisted "sequence number" from the main thread, such that upon restart it can request resend of fix messages based on what has really been processed. 3. Another option is to not have quickfix spawn its own thread, but instead we have a mechanism were we would periodically call some QF function so quickfix can do its processing, effectively having a single threaded application. Are any of these feasible options and if so what will need to be done on our side?=20 We are exploring these options as we would like to avoid having business logic code running in multiple threads if that's possible. Thanks in advance, Sridhar Vasudevan |