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