Skip to content

An example project showing that happens under the surface when using coroutines to suspend and resume on a background thread and a DispatcherQueue.

License

Notifications You must be signed in to change notification settings

DarranRowe/CoroTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoroTest

A sample project showing the concepts of what happens when a coroutine is used to switch a function to a background thread and then back to the UI thread when using a DispatcherQueue.

Implementation Notes

The DispatcherQueue is modeled as a message only window. There is enough evidence in the call stack to indicate that this is how a DispatcherQueue is implemented.

The default thread pool is used. C++/WinRT uses the WinRT thread pool, but this should just be a wrapper over the Windows thread pool functionality.

The concrete functions used for the thread pool and dispatcher are in the awaiter. The threadpool work function is a captureless lambda which calls resume on the coroutine handle. The dispatcher function is a lambda that again calls resume on the coroutine handle.

About

An example project showing that happens under the surface when using coroutines to suspend and resume on a background thread and a DispatcherQueue.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages