On Wed, 2016-04-13 at 17:17 +0800, lh_mouse wrote: > Hi all, > > The 'win32' thread model of gcc has been there since long long ago, being > compatible with very old Windows versions, also having a number of drawbacks: > 0) its implementation is very inefficient, and > 1) its mutexes and condition variables require dynamic initialization and > are unusable in C++11 as std::mutex requires a `constexpr` constructor, and > 2) allocating a number of rarely used mutexes or condition variables would > eventually make the system run out of kernel objects. > > As a solution for 1) and 2), Microsoft introduced keyed events, details of > which can be found here: > http://joeduffyblog.com/2006/11/28/windows-keyed-events-critical-sections-and-new-vista-synchronization-features/
Have you looked at WaitOnAddress and WakeByAddressSingle / WakeByAddressAll too? AFAIK this is new in Windows 8, and seems similar to futexes. I think it might be better to get a std::synchronic (or similar) implementation into GCC, and then use these to implement at least the mutexes: https://github.com/ogiroux/synchronic/blob/master/include/synchronic One benefit would be that we then have one place where we have optimized spinning/blocking in libstdc++ on Windows, and less platform-specific code. ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
