<div dir="ltr">What David said makes sense, I was looking at std::mutex implementation two days ago and turns out that Microsoft used critical section in VS 2010 but changed it to something custom later on. I don't know the exact details but the only reason I could come up with was that they couldn't meet all the standard requirements for std::mutex. This thread has a bit more info <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__social.msdn.microsoft.com_Forums_vstudio_en-2DUS_3a9387ed-2Df15f-2D4b80-2D944e-2D180f41980a2c_stdmutex-2Dperformance-2Dcompared-2Dto-2Dwin32-2Dmutex-2Dor-2Dcritical-2Dsection-2Dapis-3Fforum-3Dvcgeneral&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=1pbs1nJ_1UbOihqHy9labjdbsTAqOUgEskBH4EX6PpE&s=4SgB0VrGvoDqKm0_D814LBM7iliCJ2ZzLn0722OglqI&e=">https://social.msdn.microsoft.com/Forums/vstudio/en-US/3a9387ed-f15f-4b80-944e-180f41980a2c/stdmutex-performance-compared-to-win32-mutex-or-critical-section-apis?forum=vcgeneral</a></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 2, 2015 at 8:02 PM, Dennis Luehring <span dir="ltr"><<a href="mailto:dl.soluz@gmx.net" target="_blank">dl.soluz@gmx.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">isn't boots threads implementation the best place to look for windows/posix related implementations - because there are currently c++11 <thread> conform on these platforms?<br>
<br>
it would be sad to see libc++ development go through the same system-specific-bugs/special behaviour research again<br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.boost.org_doc_libs_1-5F58-5F0_doc_html_thread.html&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=1pbs1nJ_1UbOihqHy9labjdbsTAqOUgEskBH4EX6PpE&s=yBS6C79VoKLwjjF2erSBalCWRy1tNOP4uofywqT9Rbw&e=" rel="noreferrer" target="_blank">http://www.boost.org/doc/libs/1_58_0/doc/html/thread.html</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.boost.org_doc_libs_1-5F58-5F0_doc_html_thread_changes.html&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=1pbs1nJ_1UbOihqHy9labjdbsTAqOUgEskBH4EX6PpE&s=zrGlAosyJJ6C2JB52Kmvt-xUr4sePwg3gYdyfF_enPs&e=" rel="noreferrer" target="_blank">http://www.boost.org/doc/libs/1_58_0/doc/html/thread/changes.html</a><br>
<br>
Am 02.07.2015 um 11:44 schrieb David Chisnall:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
On 2 Jul 2015, at 10:33, Kim GrÀsman <<a href="mailto:kim.grasman@gmail.com" target="_blank">kim.grasman@gmail.com</a>> wrote:<br>
><br>
> Windows also has a light-weight mutex concept they call critical<br>
> sections, it's been around since forever. That's what std::mutex<br>
> should map to, not the Windows Mutex.<br>
<br></span>
Unless Iâ  m missing something (and I may well be - last time I wrote any Win32 code, NT 5 was in beta), CriticalSection objects can not:<br>
<br>
  - Specify a timeout after which theyâ  ll stop blocking (maybe you can do this by combining TryEnterCriticalSection and WaitForSingleObject?)<span class=""><br>
<br>
  - Be atomically released when waiting on a condition variable and reacquired<br>
<br></span>
Both of these are required for std::mutex.  SRWLocks support the second, though donâ  t seem to provide a clean way of implementing the first.<span class=""><br>
<br>
David<br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</span></blockquote><div class="HOEnZb"><div class="h5">
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div>