<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 02/09/2012 10:53 AM, Antonio Fortuny wrote:
<blockquote cite="mid:jh052q$9uc$1@dough.gmane.org" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<br>
<br>
I've made a test on Win32 and the TEventObject is blocking system
wide. </blockquote>
Great !<br>
<br>
If this feature is really usable on all platforms, the documentation
needs to be updated accordingly. <br>
<br>
AFAIK: <br>
<br>
System wide inter-process semaphores should be a lot slower than
in-process inter-thread semaphores. With inter-Thread sync, for
99,99% of the calls, expensive OS-Calls (and thus context switches)
can be avoided.<br>
<br>
On Linux, there is FUTEX vs. MUTEX (I did a lot of research on this
issue). Regarding Lazarus, for inter-Thread stuff (TCriticalSection
and friends) Lazarus uses the pthread library which in fact does
FUTEX (if available for the architecture it runs on, MUTEX
otherwise). AFAIK, Windows also provides dedicated fast inter-thread
mechanisms. <br>
<br>
Thus it does make sense to use TCriticalSection for inter-thread
stuff and those SyncOBJ functions, that are documented to be usable
for inter-Process work, when necessary. <br>
<br>
-Michael<br>
<br>
</body>
</html>