View Single Post
  #10 (permalink)  
Old April 23rd, 2007, 06:52 AM
planoie's Avatar
planoie planoie is offline
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I am not an expert on threading. I've just used it enough to get myself into trouble ;).

It would appear your description is correct. From the MSDN docs for Thread.Join Method () :
"Blocks the calling thread until a thread terminates, while continuing to perform standard COM and SendMessage pumping."

Yes, the main (UI) thread never exits until you close/exit the application.

Are you looking to *suspend* the worker thread while the GUI updates? Or do you actually want to stop it?

If you want to suspend it, I'd ask the question: Why would you want to do that? The whole point of a worker thread is so you have a thread doing the work as quickly as possible in the background while still allowing the main (UI) thread to update and access messages (i.e. button click, etc). Suspending the worker thread for UI updates will just slow things down. There may be better ways to do this, such as not ALWAYS updating the UI. Instead you update it on some time interval.

-Peter
Reply With Quote