[rabbitmq-discuss] Multithreading and rabbitmq-c

Artsiom u2.storm at gmail.com
Thu Mar 15 13:57:07 GMT 2012


I some questions concerning multithreading and using multiple channels 
within single connection.

Is structure amqp_connection_state_t is thread-safe?
Can I share connection between threads and at the same time
use separate channel for each thread in producer app? and in consumer app?

The second part of the question(about consumer) is needed to be explained.
When I looked at API, I didn't find any difficulties to use many 
channels within single connection
in producer app, because each method (declare queue\exchange, bind, 
publish & etc) has
"channel" parameter.

But in consumer app, where it is needed to receive messages (or frames 
as shown in example .c-files),
we have to call wait_for_single_frame method, which is lack of "channel" 
method.
Could you give an advice how to organize "multichannel" message fetch from
one queue?


*OR*
It is better to use separate connection for each thread and have no 
problems? :)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120315/3350851d/attachment.htm>


More information about the rabbitmq-discuss mailing list