Boost logo

Boost :

Subject: Re: [boost] [ASIO] Having a hard time after upgrading my boost libraries
From: Gaetano Mendola (mendola_at_[hidden])
Date: 2013-05-20 15:47:52


On 19/05/2013 14.54, Arpan Sen wrote:
> Folks,
>
> I recently moved to boost 1.52, been using a pretty old version of boost earlier. Quite a number of pieces of my code have stopped working since then, but the one that's really a pain is the ASIO piece. I have a lot of code that makes use of ASIO's async read/write and other calls and there seems to be a problem reading data from socket with async_read_until - sometimes I get empty string, there's valid data at other times.
>
> My code is heavily multi-threaded. This problem doesn't show up in single threaded environment at all. My OS is SUSE 11 and g++-4.3.3 as the compiler. I may have to post some code eventually but on the top off your head - do you have any pointers for me?

Consider that the buffer you are passing to your async calls has to
survive the handler.
How many threads are running the io_service::run ?
Consider that boost::asio::sockets are not multithread so only one
thread at time can call the async calls on it.
Can the handlers running concurrently ? If not you have to use the
strand.

Regards
Gaetano Mendola


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk