Expand Minimize

EnterUmsSchedulingMode function

Converts the calling thread into a user-mode scheduling (UMS) scheduler thread.

Syntax


BOOL WINAPI EnterUmsSchedulingMode(
  _In_  PUMS_SCHEDULER_STARTUP_INFO SchedulerStartupInfo
);

Parameters

SchedulerStartupInfo [in]

A pointer to a UMS_SCHEDULER_STARTUP_INFO structure that specifies UMS attributes for the thread, including a completion list and a UmsSchedulerProc entry point function.

Return value

If the function succeeds, it returns a nonzero value.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

An application's UMS scheduler creates one UMS scheduler thread for each processor that will be used to run UMS threads. The scheduler typically sets the affinity of the scheduler thread for a single processor, effectively reserving the processor for the use of that scheduler thread. For more information about thread affinity, see Multiple Processors.

When a UMS scheduler thread is created, the system calls the UmsSchedulerProc entry point function specified with the EnterUmsSchedulingMode function call. The application's scheduler is responsible for finishing any application-specific initialization of the scheduler thread and selecting a UMS worker thread to run.

The application's scheduler selects a UMS worker thread to run by calling ExecuteUmsThread with the worker thread's UMS thread context. The worker thread runs until it yields control by calling UmsThreadYield, blocks, or terminates. The scheduler thread is then available to run another worker thread.

A scheduler thread should continue to run until all of its worker threads reach a natural stopping point: that is, all worker threads have yielded, blocked, or terminated.

Requirements

Minimum supported client

Windows 7 (64-bit only) [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

WinBase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

ExecuteUmsThread
Multiple Processors
UMS_SCHEDULER_STARTUP_INFO
UmsSchedulerProc
User-Mode Scheduling

 

 

Community Additions

ADD
Show:
© 2014 Microsoft