Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] Proper threads clean up at exit


Chronological Thread 
  • From: "Bo Huang" < >
  • To: < >
  • Subject: [Manta] Proper threads clean up at exit
  • Date: Fri, 27 Mar 2009 12:10:46 -0400

Hi
 
I need a mechanism that stops the rendering the threads while blocking the 
main thread. Then let main thread delete rtrt and and then continue 
execution. 
 
Currently my main thread creates four manta rendering threads and let them 
run, while the main thread processes system events, creates callbacks and 
feed to Manta.
 
When it is time to destroy Manta, in my main thread I call delete rtrt. But 
the other four threads are still running and operate on partially delete 
memory, hence the execution crashes.
 
I tried asking each worker to stop, Thread::exitAll(0), and etc., prior to 
calling delete rtrt. But they do not seem to help, perhaps these calls are 
not executed immediately? Possibly have to use callbacks?
 
I also tried running the command line version of Manta with argument 
"-ui" "null" "-scene" "scene_0()" "-res" "512x512" "-imagedisplay" 
"file(testmanta -type tga)"
 
The images render fine. But when I close the dos window, I see some errors 
that quickly disappear. (I discerned null thread pointer) In any case, I do 
not hit the break point I set at delete rtrt in manta.cc.
 
Hence I wonder if these two are related.
 
Thanks
 
Bo



Archive powered by MHonArc 2.6.16.

Top of page