abouth threads

  • Thread starter Thread starter rocio
  • Start date Start date
R

rocio

When developing fot he PocketPC, when do one need to worry about threads? I
have finished developing a windows app. for the Pocket PC, without using any
threads, and was wondering when& how to use them. Can anyone point to a good
intro. of threads for the .NET CF ?

Thanks for all your comments & replies to my postings here. You all were
very helpful.
 
You should use threads when multiple operations need to be taking place at
the same time, effectively. The classic example of a multi-threaded GUI
application is one where the user interface continues to respond while a
long file copy is taking place. The GUI provides the dialog showing the
progress, or even the ability to do more things, while the worker thread
performs the copy and notifies the GUI thread of its progress as it goes
along.

Don't think of threads as a cool thing that any good program should use. If
you need them, I think you'll know it...

Paul T.
 
When you are continuously drawing something like in

for (;;)
e.Graphics.DrawImage(bmp,100,100);

}

you need a thread, otherwise you can't acces other things of the program,
like minimize, max, put some text in a textbox,...........



Greetz

JC
 
You shouldn't be drawing from threads other than the UI thread. The UI
thread *owns* the display windows of the application and using them from
other threads will cause you problems. Further, it's a poor design to be
drawing from 50 different places in the code.

Paul T.
 
Thanks for your replies.
I do not think my app. will benefit or needs threads for the moment then.
 
Back
Top