Write to boost::asio socket from different threads?

Well according to the documentation tcp::socket is not thread safe when shared between multiple threads. So you either do a synchronisation like you suggested with boost::mutex or you use async write. The io_service the work for you.

Write and async_write are not thread safe in the manner you are using them. The canonical way to approach this is to queue your messages, then write them out one at a time.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions