Boost logo

Boost :

Subject: Re: [boost] [asio] possible multi-threaded bug with async_write_some()
From: Brian and Victoria (bnv_at_[hidden])
Date: 2009-03-21 07:03:24


I neglected to note that this is under Cygwin with
-DBOOST_ASIO_DISABLE_IOCP -DBOOST_ASIO_ENABLE_CANCELIO.

-Brian

Brian and Victoria wrote:
> I'm running asio (boost 1.38) multi-threaded, and noticed that on a
> context switch between threads, my handler for async_write_some() will
> sometimes get invoked with no data transferred. My handler would call
> async_write_some() again if there was remaining data, but this caused
> (most of) the data to get sent twice since there appears to still be a
> call to the handler pending in the work queue.
>
> I'm not sure if this behavior is a bug or not, but the solution was to
> check for 0 data transferred and exit the handler if so.
>
> -Brian


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