[1/1] kernel32: Implemented basic NUMA functions to replace the stubs

Chris Moeller kode54 at gmail.com
Sun Jul 28 18:33:04 CDT 2013


Main changes from HEAD:
1) Implements GetNumaHighestNodeNumber which simulates a typical single node system.
2) Implements GetNumaNodeProcessorMask which returns the global processor affinity mask for node 0, otherwise returns an error.
3) Implements GetNumaAvailableMemoryNode which returns available physical memory for node 0, otherwise returns an error.

This much of the behavior was observed based on a single processor (4 cores) Windows 7 system. These functions are utilized by the synchronization and threading primitives incorporated in the MSVC 2012 and newer C and C++ runtime libraries. concrt.h/Concurrency::critical_section, which is used by both std::mutex and std::thread, will throw an exception the moment the object is locked if GetNumaHighestNodeNumber fails, and there are at least a few examples of software which don't bother to catch this exception and thus crash, such as the alpha version of Cube World, and certain versions of the foo_wave_seekbar component for the foobar2000 audio player. The associated scheduling code appears to make use of GetNumaNodeProcessorMask as well to control how many threads are allowed to spin up at once, or so I guess without looking very deeply into the CRT source code.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-kernel32-Implemented-basic-NUMA-functions-to-replace-t.txt
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20130728/32c0baef/attachment.txt>


More information about the wine-devel mailing list