[vtkusers] RE: problem about multithread and VTK

Nigel Nunn nNunn at ausport.gov.au
Sat Mar 30 04:37:05 EST 2002


How about something like this: 
 
- Both buttons and Vtk RenderWindow on original thread. 
- Pressing "A" starts background thread, clears flag. 
- Pressing "B" sets global flag. 
- Background thread loops: 
 
   1.   Sleep(n);  // milliseconds
   2.   if (flagSet) 
   2a     end thread; 
   3.   SendMessage(VtkWnd, SHOW_NEXT_FRAME); 
 
On Win32/C++, WaitForSingleObject(...); is handy, 
Nigel 



More information about the vtkusers mailing list