birdsong wrote: > 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: > > threading.Semaphore(100)
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. Christian -- http://mail.python.org/mailman/listinfo/python-list