
Hi, I'm a beginner in using boost asio library (and coding c++ too :). I am currently trying to code a simple application that handles some communication with a server through TCP/IP connection. My I/O Class has two threads that use synchronous socket operations on the same socket (which is a member of the class) Main thread: CApplication::Close() - socket.close() CApplication::Open() - socket.open(boost::asio::ip::tcp::v4()); - socket.write_some(boost::asio::buffer(initial_command)); - socket.read_some(boost::asio::buffer(initial_command_reply)); CApplication::Write(data from another class) - m_Socket.write_some Workerthread: CApplication::thread_Run() do { - socket.read_some(boost::asio::buffer((void *)&character, 1)); - package bytes to messages and pass them on to another class } while (!bClosed) My question is that is it safe to call write_some and read_some from different threads without synchronization. The application is now working w/o problems but I need to be sure that this is a safe way to do this before continuing development. Thanks for your reply, James -- View this message in context: http://www.nabble.com/-ASIO--Thread-safety-of-socket.write_some---socket.rea... Sent from the Boost - Users mailing list archive at Nabble.com.