Boost logo

Boost Users :

Subject: Re: [Boost-users] boost concurrent write/read
From: Marco Piacentini (marcopiacenta_at_[hidden])
Date: 2011-03-09 06:41:01


ok...then it means that the asyncronous operation needs to be transformed in a sync operation? ________________________________ Da: Rutger ter Borg <rutger_at_[hidden]> A: boost-users_at_[hidden] Inviato: Mer 9 marzo 2011, 12:31:49 Oggetto: Re: [Boost-users] boost concurrent write/read On 03/09/2011 12:14 PM, Marco Piacentini wrote: > I have a simple TCP multiprocess server...inside each child server(each > of one handles distincted connection), I call a list of > operation...suppose the following: > > > socket.async_read_some(....); //receive a client request > socket.async_write_some(...); //respond to client request > > socket.async_write_some(...); //independently of the client request, > send something to the client > > Have I use strand,or this situation doesn't cause problems? > I don't use thread... > thanks!!! Without threads, you don't need a strand (the strand is implicit). But, even without threads, you still would need to make sure that the read or write operation is completed before issueing your next request. So, socket.async_read(...); // OK socket.async_write( ... ); // OK socket.async_read( ... ); // Potential error: 1st async_read may be still in progress Regards, Rutger _______________________________________________ Boost-users mailing list Boost-users_at_[hidden] http://lists.boost.org/mailman/listinfo.cgi/boost-users



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net