Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] schedule work on all threads of a single io_service::run() pool?
From: Igor R (boost.lists_at_[hidden])
Date: 2013-05-18 13:54:46


> Is there a way to ask the io_service to distribute a particular
> handler to every thread that is running the service?
> My use case is per-thread watchdogs, and I need the worker threads to
> ping the watchdog on some regular interval (e.g., every 5 seconds).

No, io_service threads are expected to be used for scalability
purposes only, and the application logic is expected to be "decoupled"
from the threading.
What you can do instead is to use multiple io_service's, instead of
multiple threads running 1 io_service (see io_service-per-CPU
example).


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net