[Insight-users] Re: [Insight-developers] Win32OuptutWindow

Brad King brad.king at kitware.com
Tue Aug 16 10:09:19 EDT 2005


Miller, James V (Research) wrote:
> I think what I was planning to do was to have the MultiThreader spawn
> N threads instead of N-1 threads.  Currently, the MultiThreader spawns
> N-1 threads for processing N-1 pieces of an image and uses the main
> thread for processing the last piece.  I think if it spawned N 
> threads then the main thread could be left for handling the messages
> from the individual threads and further separate processing threads
> from threads that may be managing a UI.  (The other idea was to put
> the Win32OutputWindow in its own thread.)

Spawning N threads would probably work well.  Then the main thread could 
use MsgWaitForMultipleObjects to wait for all the threads to finish with 
only one call instead of a loop of WaitForSingleObjects.  It also feels 
more symmetric.

> I don't think we 
> can institute that Get methods cannot be called from within a 
> ThreadedGenerateData method.  That would place too much of a burden
> on the developer (particularly new developers).

Good point, that's fine with me.  If the main thread is not involved 
then it will always be able to process messages quickly and will not 
have the problem Karthik encountered.

-Brad


More information about the Insight-developers mailing list