$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] [Asio] Socket Read/Write Thread-Safety
From: Timothy Liang (timothy003_at_[hidden])
Date: 2011-01-28 00:48:31
Hi, I'm implementing a full-duplex protocol over TCP/IP using Boost.Asio.
Multiple threads will be calling 'io_service::run_one()', so I have to
serialize my completion handlers. Since I need to be reading and writing on
a socket at the same time, can I use the 'boost::asio::async_read(...)' and
'boost::asio::async_write(...)' functions? The documentation states that
these are implemented in terms of calls to the stream's async_read_some and
async_write_some functions, and the 'basic_stream_socket' class isn't
thread-safe.
Thanks,
Timothy