[openamq-dev] Multi-threaded connection requests fail?

Elli Barasch comptonsw at comcast.net
Thu Nov 8 14:12:18 CET 2007


Yes, I get NULL back.  As for your second comment, I thought so also, 
which is why my code
performs private connections within the threads.

I have been stepping through the code.  Does GDB get in the way?

BTW - I only have a single core on this PC. Would that have any effect?

Elli

Martin Sustrik wrote:
> Elli,
>
>   
>> Attached is a noodled-up adaptation of your amq_client.c, linked against 
>> pthreads. 
>> Strangely, I did have success exactly once, so I am still not sure what 
>> is going on...
>>
>> The problem lies on the first connection_new call.  I can't get past that.
>>     
>
> The first connection_new works ok for me although I get 'no such queue 
> defined' error later.
>
> What exactly does connection_new return on your box? NULL?
>
>   
>> Further, must the thread functions declare their own private 
>> connections, or may they attach their sessions
>> to the process global connection established by the main function?
>>     
>
> Connection and session objects aren't thread-safe. If you want to use 
> openAMQ from 2 different threads, you should create two separate 
> connections.
>
>   
> Martin
> _______________________________________________
> openamq-dev mailing list
> openamq-dev at lists.openamq.org
> http://lists.openamq.org/mailman/listinfo/openamq-dev
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openamq.org/pipermail/openamq-dev/attachments/20071108/cfbd8d50/attachment.htm 


More information about the openamq-dev mailing list