I have implemented a C++ class which launches a separate thread accepting connections (with boost::asio
). The whole class is intended to be an asynchronous "command receiver" for a bigger program.
The main trouble is: when waiting for incoming connections, the thread is substantially idle. My perception is that this is wasting processor time (and hardware thread) just doing nothing. Is there any way to execute the thread with a lower priority, or some other way to make the thread not to interfere with the main program, which is both task intensive and threaded?