Peter Hansen wrote:
(But if you can accept those drawbacks, keep doing what you're doing.
Also consider searching the archives for discussions involving the
"dis" module (google for "dis.dis" maybe?) and see how to learn for
yourself what is atomic and what's not.)
Thanks, Peter. I googled groups o
Mike Rovner wrote:
Hello,
Please advise on multi-threaded list *append*:
import time, random, thread
aList = []
def main():
for i in range(10):
thread.start_new_thread(updater, (i,))
time.sleep(30)
print aList
def updater(n):
global aList
time.sleep( random.randint(1,n+1) )
aList.ap
Hello,
Please advise on multi-threaded list *append*:
import time, random, thread
aList = []
def main():
for i in range(10):
thread.start_new_thread(updater, (i,))
time.sleep(30)
print aList
def updater(n):
global aList
time.sleep( random.randint(1,n+1) )
aList.append(n)
if __name__