[Lazarus] Using semaphores to limit thread access

Michael Schnell mschnell at lumino.de
Mon Jul 20 11:52:22 CEST 2015


On 07/20/2015 10:42 AM, kapibara wrote:
> I'm afraid that if a TCriticalSection is used, all threads except one 
> is blocked.
No. Only those that try to acquire the CriticalSection while they are 
owned by another thread.

Critical section is just a binary (non counting) Semaphore). I never had 
a problem when using them,

Of course counting semaphores and priority control for the waiting 
threads in some cases is needed.

-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150720/d050dbdb/attachment-0003.html>


More information about the Lazarus mailing list