I am not sure about one detail related to strands.
Suppose the following situation: two independent objects each one with his own strand. And each strand related to one common io_service. Each object use his strand for posting and wrapping async operations. If I have this (unique) io_service .run()'ing on several threads, I am not sure if the following will happen:
All operations posted and async wrapped by one of the objects will be executed non concurrently. So all operations related to one of the objects will be executed serially (Posted operations will be executed in the same order than they were posted. Wrapped async operations will be executed in an unspecified order because they are asynchronous but still being executed serially).
Two operations originated in different objects (and therefore posted or wrapped from different strand objects related to the same io_service) could be executed concurrently.
In summary, each object will execute his posted and wrapped handlers serially but handlers posted and wrapped from different objects (strands) will execute concurrently.
+-----------------+ +-----------------+ | Obj1 | | Obj2 | | +-------------+ | | +-------------+ | | | Strand_1 | | | | Strand_2 | | | +-------------+ | | +-------------+ | +--------+--------+ +-------+---------+ | | +--------+ +-------+ | | +----+--+----+ | io_service | +------------+ | | +--------+-------+ | | Thread1 Thread_2 io_service.run() io_service.run()
Am I right?
Thank you