
On 9/14/2013 8:54 AM, Quoth Jason Roehm:
Does the contemporary Boost.Coroutine have the same limitation, or is it safe to create a coroutine in one thread and then resume it in another?
While I can't answer this question directly, I can point out that the examples for Boost.Asio 1.54 show using coroutines as composed operation handlers, and that naturally Boost.Asio makes no particular guarantees that only one thread will be used to run handlers (eg. if multiple threads have called "io_service::run"). So presumably it should be fine, unless this is an oversight somewhere. It's likely however that for things to remain safe you will have to either only have one "run" thread or to use strands or some other mutual-exclusion method to protect against concurrent execution of the same coroutine. (Also note that there have been some fairly dire warnings of problems with the IOCP scheduler in 1.54 on Windows, so tread carefully.)