DUNE-DAQ / iomanager

Package providing a unified API
0 stars 0 forks source link

Too-long sleep in callback thread makes app `stop` slow #18

Closed philiprodrigues closed 2 years ago

philiprodrigues commented 2 years ago

The event loop thread that's used for callbacks has a 500ms timeout on try_pop(), here:

https://github.com/DUNE-DAQ/iomanager/blob/df681a625b5fe1c679a2ec7eac29dca7a0147d5d/include/iomanager/Receiver.hpp#L157

At stop, when modules call remove_callback, they have to wait for the try_pop to timeout. stop is called serially (not in parallel) on modules, so this can make for long stop times. In particular, the readout app stop time in v3.0.0-rc5 can be several seconds, mostly due to this wait.

Fix is just to reduce the timeout. Say, 5ms?