19 Jun
2018
19 Jun
'18
7:30 a.m.
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...