<div dir="ltr"><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_extra"><div class="gmail_quote">2014-10-02 22:23 GMT+08:00 Xiangrong Fang <span dir="ltr"><<a href="mailto:xrfang@gmail.com" target="_blank">xrfang@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div style="font-family:'courier new',monospace"><br></div><div class="gmail_extra"><div class="gmail_quote"><span class="">2014-10-02 22:09 GMT+08:00 Michael Schnell <span dir="ltr"><<a href="mailto:mschnell@lumino.de" target="_blank">mschnell@lumino.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
AFAIR, in Linux, the fpc RTL calls the pthread library "mutex..." function. This library uses Futex, if the arch supports that, and uses the plain old MUTEX system call if the arch does not support FUTEX.</blockquote></span></div></div></div></blockquote><div><br></div><div class="gmail_default" style="font-family:'courier new',monospace">I found some quotes online:</div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default"><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex" class="gmail_quote"><font face="courier new, monospace">For Windows, critical sections are lighter-weight than mutexes.<br></font><font face="courier new, monospace">Mutexes can be shared between processes, but always result in a system call to the kernel which has some overhead. </font><font face="courier new, monospace">Critical sections can only be used within one process, but have the advantage that they only switch to kernel mode in the case of contention.</font></blockquote><div><br></div><div><font face="courier new, monospace">I only need lock WITHIN my own application, so, it seems that critical sections are better.</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">Xiangrong</font></div></div></div></div></div>