Tim Peters wrote: > > > ... > > Hmm, so maybe we're not after lists after all: maybe what > > we need is access to the global interpreter lock in Python, > > so that we can write: > > > > sys.lock.acquire() > > if list: > > obj = list.pop() > > else: > > obj = default > > sys.lock.release() > > The thread attempting the sys.lock.acquire() necessarily already owns the > global lock, so the attempt to acquire it is a guaranteed deadlock -- > arguably not helpful <wink>. True, sys.lock.acquire() would have to set a flag *not* to release the lock until the next call to sys.lock.release(), which then clears this flag again. Sort of a lock for the unlocking the lock ;-) Could this work, or am I having a mind twister somewhere in there again ? -- Marc-Andre Lemburg ______________________________________________________________________ Y2000: 160 days left Business: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4