12

io_service::poll_one Run the io_service object's event processing loop to execute one ready handler.

vs

io_service::run_one Run the io_service object's event processing loop to execute at most one handler.

From that explanation it would seem poll_one could execute more than one handler? Does run_one or poll_one use any thread that's called run() or only the thread that calls poll_one/run_one?

The documentation for ASIO is very sparse.

Sam Miller
  • 23,808
  • 4
  • 67
  • 87
Eloff
  • 20,828
  • 17
  • 83
  • 112

1 Answers1

17

poll_one will return immediately (non-blocking) in case there is no event to process.

run_one will block the calling thread until one event is ready to process.

You could also check some documentation here

Cătălin Pitiș
  • 14,123
  • 2
  • 39
  • 62