single thread decrement a semaphore object more than once?
lists at cheimes.de
Wed Feb 25 05:57:43 CET 2009
> I searched but didn't see this already discussed, sorry if I didn't
> search hard enough.
> Can I decrement a semaphore's counter within the same thread more than
> once? I'd like to set hard and soft limits in a server I'm writing.
> The server upon initialization would create a semaphore:
Yes, you are not restricted to multiple threads. A semaphore ensures
that the counter is thread safe. It doesn't force you to use threads.
More information about the Python-list