[fpc-pascal] Counting semaphore for free pascal
Michael Schnell
mschnell at lumino.de
Thu Jul 30 09:53:08 CEST 2015
On 07/29/2015 01:06 PM, Michael Schnell wrote:
> On 07/29/2015 12:35 PM, Serguei TARASSOV wrote:
>>
>> critical sections are not.
> Hmmm I suppose this is "fpc speak".
Thinking about this I feel that "CriticalSection" (the official name of
this functionality is Mutex) and "Event" is "fpc speak". "Event even has
several different meanings in "fpc speak, e.g. TEvent (which is some
kind of Thread-Semaphore ) and and "Event" function to be settable in a
class (the general name of such construct is "Callback").
In the Linux OS/Libraries, you have Mutex in both variants. For (Posix)
threads in pthreadlib and for processes as a system call.
When used with threads, a Mutex in pthreadlib for supported archs
automatically is done as a FUTEX that is much faster as it does not do a
system call when the Mutex is not already taken by another thread.
-Michael
More information about the fpc-pascal
mailing list