Subject: Re: [boost] [asio] RFC on new reliable UDP library
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2014-10-17 18:27:15
On 17 Oct 2014 at 10:54, Juan Carlos Franzoy wrote:
> > A long term dream of mine is for ASIO to become the standard event
> > dispatch loop for all C++ programs, so other libraries simply hook
> > into ASIO's dispatch and everything interoperates cleanly without
> > lots of hassle and brittle boilerplate. I also feel a grievance
> > against every single library firing up their own thread pools or
> > worker threads when ASIO gives you that for free.
> We tried to use ASIO as an event dispatch, but it failed to scale in
> multicore machines. Currently we are experimenting using one io_service
> per core and manually managing the load balance migrating sockets between
If this is on Linux, then yes I have found this too. ASIO uses
std::mutex as its lock, and the spin count on pthread_mutex in glibc
is too short for modern CPUs.
My proposed concurrent_unordered_map, which can do safe concurrent
erase, would solve the need for ASIO needing a central mutex on
> Maybe ASIO has to manage only io (only io threads) and has to delegate
> to an external thread pool the execution of user handlers. Although I
> don't know if it is technically possible.
ASIO's present design is suboptimal in many regards. It's one of my
biggest qualms in the present design being standardised as-is. I may,
six months from now, be able to say in considerable detail what
exactly to change if things pan out.
-- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk