On Tue, Apr 16, 2013 at 07:13:15PM +0200, Maki Camara wrote:
> Connor,
> 
> I have thought of delegating the recv to another thread, but what I
> would like to have idealy is to
> avoid the loop(while(true)) to ensure minimal use of the cpu

Sorry to not reply before, I was on holiday yesterday.

I don't think the blocking model will put much stress on the CPU. while
no messages are returned, the get/fetch methods will sit and do nothing
for the timeout period specified (or forever if no timeout is provided).
It won't simply loop repeatedly.

What language are you looking to use (you may have said and I'm just
forgetting or haven't seen the message yet)? In Ruby I've been playing
with the idea of registering blocks for Receiver.get, Receiver.fetch
and Session.next_receiver that would act as a multiplexer for incoming
messages and for receivers with pending local messages.

-- 
Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc.
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/

Attachment: pgpvXYnq9GbUj.pgp
Description: PGP signature

Reply via email to