Skip to main content

Example

A task queue can be integrated with a Windows message loop. Typically, you want callbacks queued to the completion port to run on the same thread as the message loop. The following example uses the thread pool for work but integrates completion port callbacks into a Win32 Window proc. This example also demonstrates the correct termination of a task queue when you integrate it with another threading model.

See also

Designing the task queue
Last modified on August 4, 2026