simultaneous async_read_some and async_write using strand
Hello, Q1: If I call async_write while there is a pending async_read_some in a single-threaded environment, can the write complete before the read completes? (i.e. will I need to receive some data before the write goes out?) Q2: Same question, but if I am using strand to serialize the operations. Thank you, Chris
Q1: If I call async_write while there is a pending async_read_some in a single-threaded environment, can the write complete before the read completes? (i.e. will I need to receive some data before the write goes out?)
Q2: Same question, but if I am using strand to serialize the operations.
In the both case the read and write and independent, so you can't know which completes first. Strand only serializes handler invocations, but you can't know when the handlers are enqueued.
On Mon, Aug 27, 2012 at 10:53 AM, Igor R
Strand only serializes handler invocations, but you can't know when the handlers are enqueued.
Igor, Ahh, I get it now! So I guess the clue was that strand 'wraps' the bind on the callback/handler. Thank you, Chris
participants (2)
-
Chris Stankevitz
-
Igor R