Skip to content

Latest commit

 

History

History
120 lines (95 loc) · 4.63 KB

nf-winbase-dequeueumscompletionlistitems.md

File metadata and controls

120 lines (95 loc) · 4.63 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name req.apiset
NF:winbase.DequeueUmsCompletionListItems
DequeueUmsCompletionListItems function (winbase.h)
Retrieves user-mode scheduling (UMS) worker threads from the specified UMS completion list.
DequeueUmsCompletionListItems
DequeueUmsCompletionListItems function
base.dequeueumscompletionlistitems
winbase/DequeueUmsCompletionListItems
base\dequeueumscompletionlistitems.htm
backup
91499eb9-9fc5-4135-95f6-1bced78f1e07
12/05/2018
DequeueUmsCompletionListItems, DequeueUmsCompletionListItems function, base.dequeueumscompletionlistitems, winbase/DequeueUmsCompletionListItems
winbase.h
Windows.h
Windows
Windows 7 (64-bit only) [desktop apps only]
Windows Server 2008 R2 [desktop apps only]
Kernel32.lib
Kernel32.dll
Windows
19H1
DequeueUmsCompletionListItems
winbase/DequeueUmsCompletionListItems
c++
APIRef
kbSyntax
DllExport
kernel32.dll
API-MS-Win-Core-ums-l1-1-0.dll
DequeueUmsCompletionListItems
api-ms-win-core-ums-l1-1-0 (introduced in Windows 7)

DequeueUmsCompletionListItems function

-description

Retrieves user-mode scheduling (UMS) worker threads from the specified UMS completion list.

Warning

As of Windows 11, user-mode scheduling is not supported. All calls fail with the error ERROR_NOT_SUPPORTED.

-parameters

-param UmsCompletionList [in]

A pointer to the completion list from which to retrieve worker threads.

-param WaitTimeOut [in]

The time-out interval for the retrieval operation, in milliseconds. The function returns if the interval elapses, even if no worker threads are queued to the completion list.

If the WaitTimeOut parameter is zero, the completion list is checked for available worker threads without waiting for worker threads to become available. If the WaitTimeOut parameter is INFINITE, the function's time-out interval never elapses. This is not recommended, however, because it causes the function to block until one or more worker threads become available.

-param UmsThreadList [out]

A pointer to a UMS_CONTEXT variable. On output, this parameter receives a pointer to the first UMS thread context in a list of UMS thread contexts.

If no worker threads are available before the time-out specified by the WaitTimeOut parameter, this parameter is set to NULL.

-returns

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. Possible error values include the following.

Return code Description
ERROR_TIMEOUT
No threads became available before the specified time-out interval elapsed.
ERROR_NOT_SUPPORTED
UMS is not supported.

-remarks

The system queues a UMS worker thread to a completion list when the worker thread is created or when a previously blocked worker thread becomes unblocked. The DequeueUmsCompletionListItems function retrieves a pointer to a list of all thread contexts in the specified completion list. The GetNextUmsListItem function can be used to pop UMS thread contexts off the list into the scheduler's own ready thread queue. The scheduler is responsible for selecting threads to run based on priorities chosen by the application.

Do not run UMS threads directly from the list provided by DequeueUmsCompletionListItems, or run a thread transferred from the list to the ready thread queue before the list is completely empty. This can cause unpredictable behavior in the application.

If more than one caller attempts to retrieve threads from a shared completion list, only the first caller retrieves the threads. For subsequent callers, the DequeueUmsCompletionListItems function returns success but the UmsThreadList parameter is set to NULL.

-see-also

GetNextUmsListItem