WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   running into a thread limit (https://forum.worldviz.com/showthread.php?t=229)

tavaksai 10-19-2004 04:25 PM

running into a thread limit
 
Hi guys,

I found a problem having to do with threads. I am not sure if this is a bug or if I am doing something wrong.

Basically, after executing a certain number of threads or calling functions that use threads (I am guessing Vizard's .play() uses a thread and I know viz.director() starts a thread), Vizard refuses to create or run any more threads. I load many multimedia files into my application (a dozen .avi and a dozen .wav) and I think that may be the cause. After certain number of calls .play() seems to generate the following error:
FAILED (hr=0x80007000e) in pMC->Run()
Also, if I load two dozen multimedia files and then start creating threads using python's thread library ( example: thread.start_new_thread(Animate, ()) ), eventually I get an error that says something like, "Failed to create thread" even if I don't call .play() at all.

Is this a bug in Vizard?

Max

farshizzo 10-20-2004 10:57 AM

Hi,

I'm going to test this out here. How many times do you run a director function? When you hit the thread limit, are you not able to run director functions also? Is the thread limit consistent (i.e. does it always stop working when you create a certain amount of media objects)?

tavaksai 10-20-2004 11:49 AM

threads
 
Hi Farshizzo,

Yes, viz.director() stops also even without a single execution of .play() and .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

farshizzo 10-20-2004 12:53 PM

Hi,

Thanks for the code sample, I also get an error here at thread 47. I've made a change to Vizard and now the sample works fine, even with director functions. However, I haven't tested it with media files. If you just add 30 media files and try to play them all, do you get an error?

tavaksai 10-27-2004 03:59 PM

Thanks for fixing the problem. Both the threads and multimedia files work fine now.


All times are GMT -7. The time now is 09:02 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC