View Single Post
  #3  
Old 10-20-2004, 11:49 AM
tavaksai tavaksai is offline
Member
 
Join Date: Jul 2004
Posts: 22
threads

Hi Farshizzo,

Yes, viz.director() stops also even without a single execution of <multimedia>.play() and <multimedia>.play() eventually stops working without any viz.director() calls.

Try running the following code:

import thread
import time
import viz
viz.go()

def myfunc():
sum = 0
for i in range(100000):
sum = sum + i
print 'sum is:', sum

for i in range(100):
thread.start_new_thread(myfunc, ())

On my computer, which by the way has plenty of memory, I only get 47 outputs of "sum is 4999950000" even though I create 100 threads and I get a message in red that says, "error: can't start new thread". You can replace the last line above with viz.director(myfunc) and you will get the same result except that no error message will be displayed.

Max
Reply With Quote