Skip to content

Fix excessive cpu usage in daq logging. - #69

Open
jclewett-warwick wants to merge 1 commit into
ToolDAQ:mainfrom
jclewett-warwick:fix_excessive_cpu_usage_in_daqlogging
Open

Fix excessive cpu usage in daq logging.#69
jclewett-warwick wants to merge 1 commit into
ToolDAQ:mainfrom
jclewett-warwick:fix_excessive_cpu_usage_in_daqlogging

Conversation

@jclewett-warwick

@jclewett-warwick jclewett-warwick commented Jul 22, 2026

Copy link
Copy Markdown

In this case, the zmq::poll is testing the readiness of two channels, an input channel and an output channel.
The output channel is (almost) always ready, so the poll falls straight through, without the intended 1ms pause for thought.
In the case that the output channel is not ready (essentially if it's buffer is full), then the send code below fails silently anyway, negating the value of the poll completely.
By only polling the output channel, the CPU usage in the thread is reduced from 100% to 3%, which is kinder to users working on containers on laptops (my laptop is melting trying to run this code).

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

Successfully merging this pull request may close these issues.

2 participants