Boost logo

Boost Users :

Subject: Re: [Boost-users] [Asio] Socket Read/Write Thread-Safety
From: Igor R (boost.lists_at_[hidden])
Date: 2011-01-31 02:40:03


> I'm not concerned about my own completion handlers.  The handlers in Asio's
> composed operations is the problem.  And I have no way to wrap those in
> strands.

<<In the case of composed asynchronous operations, such as
async_read() or async_read_until(), if a completion handler goes
through a strand, then all intermediate handlers should also go
through the same strand. This is needed to ensure thread safe access
for any objects that are shared between the caller and the composed
operation (in the case of async_read() it's the socket, which the
caller can close() to cancel the operation). This is done by having
hook functions for all intermediate handlers which forward the calls
to the customisable hook associated with the final handler>>
http://www.boost.org/doc/libs/1_45_0/doc/html/boost_asio/overview/core/strands.html


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