Windows 7 added an API set called UMS which allowed you to reclaim threads from user mode, and implement custom scheduling logic.
Starting with Windows 11 this feature does not appear to work. This issue is reflected on the official msdn page: https://docs.microsoft.com/en-us/windows/win32/procthread/user-mode-scheduling
While this seems to close the issue, this change was made by a stackoverflow user who added it because they experienced this issue on their Windows 11 machine. You can find this conversion on another question's comment section: UMS threads deadlocked with no error code
It is also stated on the wikipedia page for Features Removed In Windows 11 (https://en.wikipedia.org/wiki/List_of_features_removed_in_Windows_11) that UMS was removed, but the citation just links to the MSDN page.
The reason I'm suspicious is because Windows 11 is pretty new, so its possible this is just a kernel bug or unimplemented feature?
Also, this is a pretty significant feature with no replacement available. In contrast, APIs such as InterlockedExchangeAquire (https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ms683594(v=vs.85)) are still supported despite being specific to IA-64 which has been discontinued.
I could not find any official statement from Microsoft about this feature's removal.
CodePudding user response:
The official support statement is now in the documentation:
As of Windows 11, user-mode scheduling is not supported. All calls fail with the error
ERROR_NOT_SUPPORTED
.
This was added on March 15th, 2022 by Raymond Chen after it was brought to their attention, that the documentation no longer reflects reality.
CodePudding user response:
Unfortunately it looks like UMS has been officially discontinued. This was confirmed to me by a Microsoft employee a Microsoft employee with access to the Windows Kernel.
This code is currently being shipped in Windows 11:
WINBASEAPI BOOL WINAPI
EnterUmsSchedulingMode(
__in PUMS_SCHEDULER_STARTUP_INFO SchedulerStartupInfo
)
{
UNREFERENCED_PARAMETER(SchedulerStartupInfo);
SetLastError(ERROR_NOT_SUPPORTED);
return FALSE;
}
While it's technically possible that this is just a temporary "hot fix" the more likely explanation according to employees who worked on the feature is that it was removed due to lack of use.
source: https://twitter.com/itanium_guy/status/1512127881740181509