[zeromq-dev] ZeroMQ with C++ and Fibers

Steven McCoy steven.mccoy at miru.hk
Fri May 10 20:41:18 CEST 2013

On 10 May 2013 14:11, Ian Upright <ian-public at upright.net> wrote:

> If there is a message in the queue, we simply fetch the message, and pass
> that message to the Fiber that is waiting for it, and execute that Fiber.
> If
> the message queue is empty (EAGAIN), then you create more Fibers to do more
> things.  Those new Fibers will end up yielding at some point (when it needs
> IO/network/etc), at which time it switches back to the main loop to see if
> there are any new messages we can process or if we need to create some more
> Fibers to do more work.

This isn't using 0mq with fibers, it's feeding the output of 0mq into a
fiber which is entirely independent.

With green threads in general if you perform a system call and it blocks
the thread then no other fiber, on that thread, can get execution time.
So if you want to use 0mq within a fiber then it would be beneficial for
support unless this cost is acceptable.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130510/299ee59e/attachment.htm>

More information about the zeromq-dev mailing list