<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 27, 2012, at 5:02 AM, Mika Nystrom wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><br>It is interesting that the author of the thread to which you refer essentially<br>claims that C doesn't guarantee what one might think it claims. This would suggest<br>that there may be things one shouldn't assume about pthreads.<br></span></blockquote><div><br></div>There is well known paper by Hans Boehm, possibly of interest to Daniel: <a href="http://www.hpl.hp.com/techreports/2004/HPL-2004-209.html">http://www.hpl.hp.com/techreports/2004/HPL-2004-209.html</a> </div><div><br></div><div>He cites Java Memory Model paper (also of possible interest here) and Boehm states problem is being addressed at moment. So, it's maybe only of historical interest now.</div><div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">My Modula-3 code (in the thread tester program) is really nothing special.<br>Please review it yourself and let me know if you find any issues.<br>It's not particularly complicated…</span></blockquote><br></div><div>When I was implementing NPTL based threads for pm3 (around 2004) I met interesting issues with few thread programs in pm3 distribution. Those programs were written and tested with user space threads where order of thread execution was, for ready threads, always same. One was pp, as I remember...</div><div><br></div><div>I am reading your source code just now. And one thing caught my eye: "Each type of thread starts by sleeping for a while, to give the other threads a chance to be created." Does not look like any guarantee to me, not in threaded application. </div></body></html>