User-Mode Scheduling (UMS)

Windows 7 (x64) and Windows Server 2008 R2 introduce new operating system support for User-Mode Scheduling. User-mode scheduling (UMS) is a light-weight mechanism with system API’s that applications can use to schedule their own threads. An application can switch between UMS threads in user mode without involving the system scheduler and regain control of the processor if a UMS thread blocks in the kernel. UMS threads differ from fibers in that each UMS thread has its own thread context instead of sharing the thread context of a single thread. The ability to switch between threads in user mode makes UMS more efficient than thread pools for managing large numbers of short-duration work items that require few system calls.

UMS is recommended for applications with high performance requirements that need to efficiently run many threads concurrently on multi-processor or multi-core systems. To take advantage of UMS, an application must implement a scheduler component that manages the application's UMS threads and determines when they should run. Developers should consider whether their application performance requirements justify the work involved in developing such a component. Applications with moderate performance requirements might be better served by allowing the system scheduler to schedule their threads or to utilize the C++ Concurrency Runtime task scheduler as described within the next section of this document.

UMS is available starting with 64-bit versions of Windows 7 and Windows Server 2008 R2. This feature is not available on 32-bit versions of Windows. Learn more about UMS API’s at the MSDN Library online (https://msdn.microsoft.com/en-us/library/dd627187(VS.85).aspx).