cppcoro icon indicating copy to clipboard operation
cppcoro copied to clipboard

Implement io_service::process_events_until_complete

Open Uran198 opened this issue 6 years ago • 2 comments

Closes https://github.com/lewissbaker/cppcoro/issues/30

Uran198 avatar Mar 08 '18 13:03 Uran198

@lewissbaker Sorry I wasn't able to figure out a nice way to make it work with multiple threads. At the project I am working on, we decided to use explicit alternative using when_all_ready that you mentioned in the issue.

Although I've added a test you requested, IMO if it's not possible to make it work nicely with multiple threads, it may be not worth having this merged in. There is already one way to achieve desired behavior anyway.

Feel free to close a pull request and you can either cherry pick the commit with typo fix or I can open a new PR, whichever is easiest for you.

Uran198 avatar Mar 20 '18 09:03 Uran198

@Uran198 Thanks for the update. I've cherry-picked the typo fix into master.

I'll think more about the process_events_until_complete() implementation. I suspect it's not possible to wake up a particular thread from the event loop without having that thread effectively poll for completion on another thread by passing a shortish timeout to GetQueuedCompletionStatus().

lewissbaker avatar Apr 04 '18 03:04 lewissbaker