io_service::reset
documentation states that reset()
must be called before subsequent calls to run()
, run_one()
, poll()
or poll_one()
.
Questions:
- Why is this necessary? -
- What behaviour might I expect if this step is neglected?
- Why is this requirement not important enough to warrant an
assert
if it's neglected?
Some context: I finished debugging some unit-tests that checked that called poll()
repeatedly without reset()
and was attempting to check the expected number of handlers was being executed each time. It appears that with enough calls to poll()
, all handlers are eventually executed in the order expected, but it takes more calls than you would otherwise expect. Correctly calling reset()
fixes the problem, but I'm curious to know if this is the only side effect of not calling reset()
, or if there are potentially worse effects such as dropping handlers or effects that might appear in a multi-threaded example.