Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async operations on socket monitors without busy spinning? #97

Closed
dnadlinger opened this issue Jun 19, 2015 · 2 comments
Closed

async operations on socket monitors without busy spinning? #97

dnadlinger opened this issue Jun 19, 2015 · 2 comments

Comments

@dnadlinger
Copy link

dnadlinger commented Jun 19, 2015

In my fully asynchronous application, I need to keep track of the number of connections on some ZeroMQ sockets, for which I am using the socket monitor feature. However, because the monitoring socket pair uses the inproc transport, azmq resorts to polling for new events for implementing async_read. As a side effect, this leads to my program hogging 100% of its CPU core all of the time. Is there any chance to implement this more efficiently without changing ZeroMQ itself? (I'd like to avoid relying on a custom fork.)

As a workaround, I currently only check for new socket events on a timer. But this is obviously not ideal, as it introduces extra latency to the handling of these events.

@rodgert
Copy link

rodgert commented Jun 19, 2015

Have you tested with the most recent code? There was an issue fixed
recently that would lead to 100% CPU utilization.

The poll should work the same as the rest of Asio, which will block until
an FD becomes readable, or a periodic timeout occurs.

On Friday, June 19, 2015, David Nadlinger notifications@github.com wrote:

In my fully asynchronous application, I need to keep track of the number
of connections on some ZeroMQ sockets, for which I am using the socket
monitor feature. However, because the monitoring socket pair uses the
inproc transport, azmq resorts to polling for new events for implementing
async_read. As a side effect, this leads my program to hog 100% of its
CPU core all of the time. Is there any chance to implement this more
efficiently without changing ZeroMQ itself? (I'd like to avoid shipping a
custom fork.)

As a workaround, I currently only check for new socket events on a timer.
But this is obviously not ideal, as it introduces extra latency to the
handling of these events.


Reply to this email directly or view it on GitHub
#97.

@rodgert rodgert closed this as completed Apr 7, 2017
@dnadlinger
Copy link
Author

Sorry for not responding earlier; yes, I believe this has been fixed. I'm a bit hazy on the details, but I checked my code base, and I definitely reverted the timer workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants