<p>Am 29.07.2015 12:36 schrieb "Serguei TARASSOV" <<a href="mailto:serge@arbinada.com">serge@arbinada.com</a>>:<br>
><br>
> Hello,<br>
><br>
> On 29/07/2015 12:00, <a href="mailto:fpc-pascal-request@lists.freepascal.org">fpc-pascal-request@lists.freepascal.org</a> wrote:<br>
>><br>
>> A counting, or general, semaphore limits simultaneous access to a<br>
>> resource according to the number of permits you specify. On the other<br>
>> hand, a binary semaphore like a critical section limits the access to<br>
>> "one at a time".<br>
><br>
> Seems, you confuse a little semaphores and critical sections.<br>
> In general, semaphores are inter-process but critical sections are not.<br>
> I mean that semaphores allow synchronize processes whereas critical sections are designed to synchronize the threads within the same process.<br>
> Some frameworks (i.e. .NET) provide classes like "threading semaphore" but it is very particular case.<br>
> It is possible to use real semaphores to synchronize the threads too (with some overhead).</p>
<p>Semaphores don't necessarily need to be cross process.</p>
<p>Regards,<br>
Sven</p>