v3 flag enabled
Log In
Log In

Schedule work on a thread pool with low latency?

Link

https://devblogs.microsoft.com/oldnewthing/20260612-00/?p=112417

The following is a description of the Link included in the link field.

A callback that reports data from a hardware device must return quickly to prevent buffer overflow, so the received data is queued for later processing. Because the system thread pool is optimized for throughput, the queued work item can be delayed up to 100 ms when other unrelated or long‑running tasks occupy the pool, which exceeds the required 20 ms processing deadline. To eliminate this contention, a private thread pool can be created with CreateThreadPool and used as the work‑item environment, ensuring that only the required tasks compete for its threads. By limiting the private pool’s maximum thread count to one, the work items are serialized, preserving batch order while guaranteeing dispatch. The work item can be pre‑created and submitted from the callback via SubmitThreadpoolWork, reducing callback overhead.

Next Post