Boost logo

Boost Users :

Subject: Re: [Boost-users] Passing io_service to socket in implementation file after initialization in header file
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2018-06-19 07:30:00


On 19/06/2018 19:21, james wrote:
> We found a dedicated thread per io_service made things a lot easier.

Of course; that's the "one io_context, one thread" model. It's always
the easiest to code, but has other tradeoffs.

> Strands seem perfect if you want to kill any scalability so we never
> even considered patterns that required them.

Having separate dedicated threads per X is fine as long as X is
relatively small (less than #cpus). It does not scale well.

When X surpasses the #cpus, a stranded threadpool usually provides
superior performance.

If your X is hardcoded then perhaps it's not a big concern, but if it's
configurable by the end user, it might be...


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