On 19.07.2017 18:58, Karoly Balogh (Charlie/SGR) wrote:
You are free to implement Semaphore-alike behavior using CriticalSections for example, which are implemented on all platforms which support Threading in the FPC RTL.

CriticalSection is the windows-name for Futex, and in Windows (10) the appropriate Library call in fact is a hight performance user space Mutex.

In other environments TCriticalSection is implemented by a "Mutex" system call (supposedly because not all archs / OSes provide "Futex"), and seemingly pthreadlib in Linux (AFAIK) is not intended to be used for this.

Hence, generally, CriticalSection can only be used to construct inter-Thread Semaphores not inter-Process Semaphores.

-Michael
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to