Whats the benefit of Threading

Faceless Master

Freshman
Joined
Feb 11, 2003
Messages
45
Hi
I just read a tutorial about threading but couldnt figured out the benefit!
All the tut teached me is to declare a thread and call a method!
Can anyone tell whats the benfit by calling methods using threading ?
W/s
 
Two threads can run simultaneously, meaning you can have two things happening at one. If you put this code:
Visual Basic:
Dim i As Integer

Do
  i += 1
Loop Until bContinue = False
in your main program, it would freeze it. If you put it inside a second thread, the main thread would still be free to do other things, so the program would run normally. If you learn to use threading properly, it's a very powerful and useful tool.
 
EDIT:
Nevermind VF explanation is better (and he beat me to the punch). I'll just add this...

With .NET you rarely need to even bother with threading for smaller projects. .NET takes care of all the threading that's important.
 
For example; Let's say you have some code that generates reports and it takes a few minutes to complete, you can allow the user to continue with other tasks, or even generate another set of reports.
 
COol ;
Well sounds nice!
now is there any relationship between delegates and threading bcoz you can also call functions with delegats????????
 
Back
Top