[asio] when to use io_service::post or deadline_timer::async_wait?

Hi! After reading the referece docs I got the impression that the only difference between io_service::post and deadline_timer::async_wait is the fact that the former triggers execution immediately (after the caller function returns?) while the latter waits until timer expires before execution of the function object. Is this really the only difference or is there any other issue to be considered? Markus

After reading the referece docs I got the impression that the only difference between io_service::post and deadline_timer::async_wait is the fact that the former triggers execution immediately (after the caller function returns?) while the latter waits until timer expires before execution of the function object.
io_service::post() asyncronously executes a functor in one the threads running io_service::run deadline_timer::async_wait() ansyncronously waits until the timer is expired or cancelled, then executes its handler in one the threads running io_service::run
participants (2)
-
Igor R
-
Markus Werle