Hi,

We have encountered a problem with an application using QPid 0.22/APQP 0.10 with the C++ messaging API, which could be caused by creation of an excessive number of threads. This might not be related to QPid, and the issue may not even be threading in this application (the problem occurs once every blue moon, so it's a bit hard to test theories), but in order to get a clear picture of the situation, it would be good to know what threads QPid creates, and if there are any issues with threading. Some questions:

 * When exactly does QPid create a new thread?
 * Are there any known situations where one might end up with lots of
   runaway threads?
 * Do I have to do anything specific e.g. after a communication error
   in order to make sure old threads go away?

I have one connection object with one session which in turn has one sender and two receivers (for two different queues.) Whenever an exception occurs, I close down the connection using connection.close(), and reset everything else by assigning a default-constructed object, as in
session=qpid::messaging::Session();
sender=qpid::messaging::Sender();

etc.

I then (later) try to reopen using a construct like

if(!connection.isOpen())
  connection.open();

if(session.isNull())
  session=connection.createSession();
if(receiver.isNull())
  receiver=session.createReceiver(<address>);
if(receiver2.isNull())
  receiver2=session.createReceiver(<address>);
if(sender.isNull())
  sender=session.createSender(<address>);

This code is executed periodically, and is also what takes care of first-time creation after startup. This is done within a try ... catch block.



The actual problem I'm talking about is that a pthread_create() call used for something unrelated will sometimes fail with EAGAIN.

An information anyone might have about the threading behaviour of QPid would be helpful.

TIA,

- Toralf


This e-mail, including any attachments and response string, may contain 
proprietary information which is confidential and may be legally privileged. It 
is for the intended recipient only. If you are not the intended recipient or 
transmission error has misdirected this e-mail, please notify the author by 
return e-mail and delete this message and any attachment immediately. If you 
are not the intended recipient you must not use, disclose, distribute, forward, 
copy, print or rely on this e-mail in any way except as permitted by the author.

Reply via email to