[Quickfix-developers] Bug #53 - Possible deadlock if sendToTarget is called in Java fromApp() callb
Brought to you by:
orenmnero
From: Joerg T. <Joe...@ma...> - 2005-01-21 10:38:47
|
Hi all, in some rare situations Java application using QuickFIX may deadlock rendering the FIX connection dead: http://www.quickfixengine.org/bugtracker/bug.php?op=show&bugid=53 All Java objects implementing the Application interface are protected by a C++ level mutex. In some rare situations, two thread may lock the mutex of the C++ Session object and the JavaApplication mutex in different order, causing a deadlock. Typical scenario: Thread 1: started by QuickFIX, locks JavaApplication.m_mutex in fromApp(), locks Session.m_mutex in sendToTarget() Thread 2: started by Java application, locks Session.m_mutex in sendToTarget(), locks JavaApplication.m_mutex in toApp() Then the thread processing incoming FIX message is deadlocked. This is fixed in the CVS repository: http://cvs.sourceforge.net/viewcvs.py/quickfix/quickfix/src/java/JavaApplication.cpp?r1=1.16&r2=1.17 http://cvs.sourceforge.net/viewcvs.py/quickfix/quickfix/src/java/JavaApplication.h?r1=1.11&r2=1.12 You may also patch the current 1.9.4 with these two files. Cheers, Jörg -- Joerg Thoennes http://macd.com Tel.: +49 (0)241 44597-24 Macdonald Associates GmbH Fax : +49 (0)241 44597-10 Lothringer Str. 52, D-52070 Aachen |