<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 17, 2013 at 1:29 AM, Raj Kumar Sanpui <span dir="ltr"><<a href="mailto:raj.kumar.sanpui@gmail.com" target="_blank">raj.kumar.sanpui@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">If i have 10 messages in queue, and there are around 5 consumer threads, when each of them consume in turn, either using basic.consume or amqp.consume.message (the new non-blocking version):�<a href="https://github.com/alanxz/rabbitmq-c/blob/master/librabbitmq/amqp.h#L2151" target="_blank">https://github.com/alanxz/rabbitmq-c/blob/master/librabbitmq/amqp.h#L2151</a>�<div>


<br></div><div>So, as per you there should not be any thread locks, or the consume to be serialized, is not required per se.</div><div>So, basic.consume or amap.consume.message, should be thread safe by itself?</div><div>


<br></div><div>Thanks</div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 17, 2013 at 1:22 AM, Gavin M. Roy <span dir="ltr"><<a href="mailto:gavinmroy@gmail.com" target="_blank">gavinmroy@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">


Looking through the source of rabbitmq-c I see mutex code around ssl initialization (amqp_openssl.c), but I don�t see how that could cause your issue.</div><div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">


<br></div><div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">I�m wondering why you�d want to mutex either around the RPC request or if you�re calling amqp_consume_message (<a href="https://github.com/alanxz/rabbitmq-c/blob/master/librabbitmq/amqp_consumer.c#L136" target="_blank">https://github.com/alanxz/rabbitmq-c/blob/master/librabbitmq/amqp_consumer.c#L136</a>). �What does putting a lock around your �basic_consume()� invocation achieve?</div>


<div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">


Consuming is an asynchronous operation. You register your app as a consumer with RabbitMQ, then as RabbitMQ sees fit, messages are delivered to your application. Without context, I�m interpreting what you�re doing as if you want to use Basic.Get instead.</div>


<div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">

<br></div></div></blockquote></div></div></div></div></blockquote></div></div></div>