Frank Millman <[EMAIL PROTECTED]> writes: > Just out of interest, would the following, without a lock, be safe? > old, atomic_int = atomic_int, atomic_int+1 No I don't think so. But I'm told that in CPython, you can say counter = iter(xrange(10000000)) # some number that exceeds what you'll use ...
atomic_int = counter.next() and the GIL keeps it safe. When in doubt, use a lock or communicate with other threads through Queues. -- http://mail.python.org/mailman/listinfo/python-list