activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Pechorin <ivan.pecho...@gmail.com>
Subject ActiveMQ-CPP - why ResourceLifecycleManager is not synchronized?
Date Fri, 19 Feb 2010 14:39:02 GMT

Hi!

We use ActiveMQ C++ 3.1.0 client in a multi-threaded application. We use
activemq::cmsutil::SessionPool and activemq::cmsutil::PooledSession. 

Today the application crashed because methods createCachedProducer and
createCachedConsumer do not synchronize access to their shared
ResourceLifecycleManager, and ResourceLifecycleManager itself is not
thread-safe.

Relevant parts of the code are:

activemq\cmsutil\pooledsession.cpp line 101

            // Add the producer resource to the resource lifecycle manager.
            pool->getResourceLifecycleManager()->addMessageProducer( p );

activemq\cmsutil\resourcelifecyclemanager.h line 95:

        void addMessageProducer( cms::MessageProducer* producer ) {
            producers.push_back( producer );
        }

I think, ResourceLifecycleManager needs to be thread-safe, i.e. we need to
add synchronization to all of its add* methods.

Any suggestions? Maybe I misuse SessionPool or PooledSession somehow?

Best regards, Ivan
-- 
View this message in context: http://old.nabble.com/ActiveMQ-CPP---why-ResourceLifecycleManager-is-not-synchronized--tp27653021p27653021.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message