Tuesday 12 April 2016

95% CPU with select/epoll_wait in idle loop

I'm writing an MQTT client for an embedded device. It works fine for publishing but when I need to do a non-blocking check for incoming messages the CPU usage goes through the roof.I'm putting the select/epoll_wait in the idle loop as has been shown in some of the addon demos that I've read, but its clearly either: blocking the main loop if the timeout is too long (as the speed that node runs at drops to a crawl, or burning all the processor cycles).Where am I going wrong?

Submitted April 12, 2016 at 09:31PM by MrPhatBob

No comments:

Post a Comment