<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div class="gmail_extra">(forwarding to list)</div><div class="gmail_extra"><br></div><div class="gmail_extra">Hi Dave,<br><br><div class="gmail_quote">On Wed, May 21, 2014 at 8:54 PM, Dave Zarzycki <span dir="ltr">&lt;<a href="mailto:zarzycki@apple.com" target="_blank">zarzycki@apple.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
This is almost surely a bug in the port to these platforms. Appleā€™s operating system uses Mach to implement this feature, but Mach is not available on Linux and Solaris.<br></blockquote><div><br></div><div>AFAIU libdispatch on OS X uses Mach semaphores instead of POSIX ones used on Linux/Solaris. But the issue is irrelevant to OS semaphore implementation.</div>


<div><br></div><div>Actually I tried to reproduce it on OS X using (named) POSIX semaphores but failed.</div><div>I.e. the same (racy) code that hangs on Linux/Solaris doesn&#39;t hang on OS X.</div><div>I even tried simple semaphore implementation using mutex+condition variable but again no luck on OS X.</div>

<div><br></div><div>My guess is that this is related to differences in thread scheduler implementations on these OS&#39;es.</div>
</div></div></div>
</div><br></div>