So the C client is different from the Java client implementation, which says that multiple<br>threads can share a connection, but not a channel:<br><br><div style="margin-left: 40px;"><a href="http://www.rabbitmq.com/releases/rabbitmq-java-client/v1.6.0/rabbitmq-java-client-javadoc-1.6.0/com/rabbitmq/client/Channel.html">http://www.rabbitmq.com/releases/rabbitmq-java-client/v1.6.0/rabbitmq-java-client-javadoc-1.6.0/com/rabbitmq/client/Channel.html</a><br>
<br>While a Channel can be used by multiple threads, it&#39;s important to 
ensure
 that only one thread executes a command at once. Concurrent execution 
of
 commands will likely cause an UnexpectedFrameError to be thrown.
<br clear="all"></div><br>Is my understanding correct?<br><br>If I have a multi-threaded Java client that needs many channels, then it is ok (and more efficient)<br>to have one connection and construct many channels from it?<br>
<br>Thanks,<br><br>- Jim<br><br>Jim Irrer � � <a href="mailto:irrer@umich.edu">irrer@umich.edu</a> � � � (734) 647-4409<br>University of Michigan Hospital Radiation Oncology<br>519 W. William St. � � � � � � Ann Arbor, MI 48103<br>

<br><br><div class="gmail_quote">On Thu, Feb 18, 2010 at 1:05 AM, Tony Garnock-Jones <span dir="ltr">&lt;<a href="mailto:tonyg@lshift.net">tonyg@lshift.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Ragavendra,<br>
<div class="im"><br>
raghu a wrote:<br>
&gt; As per my code each thread is using different channel.<br>
&gt; May I get any �multi threaded C client samples?<br>
<br>
</div>I&#39;m sorry to say that multithreaded use of librabbitmq will not work<br>
without quite a bit of effort. It is designed for event-based systems,<br>
not multi-threaded systems. Its internal architecture is quite different<br>
from our other client libraries, where sharing connections between<br>
threads is just fine.<br>
<br>
With that said, however, you *can* use librabbitmq with a connection per<br>
thread; just don&#39;t try to share a connection or its channels between<br>
threads at the moment.<br>
<br>
Regards,<br>
<font color="#888888"> �Tony<br>
</font><div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</div></div></blockquote></div><br>