Faceless Master Posted June 28, 2003 Posted June 28, 2003 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 Quote Creativity Beyond Imagination http://www.facelessmaster.tk
*Experts* Volte Posted June 28, 2003 *Experts* Posted June 28, 2003 Two threads can run simultaneously, meaning you can have two things happening at one. If you put this code: Dim i As Integer Do i += 1 Loop Until bContinue = Falsein 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. Quote
wyrd Posted June 28, 2003 Posted June 28, 2003 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. Quote Gamer extraordinaire. Programmer wannabe.
Faceless Master Posted June 28, 2003 Author Posted June 28, 2003 Ok It means that i can run two processes art the same time? Quote Creativity Beyond Imagination http://www.facelessmaster.tk
*Experts* mutant Posted June 28, 2003 *Experts* Posted June 28, 2003 A new process is a new application, but if you have two threads they will run at the same time. Quote
Moderators Robby Posted June 28, 2003 Moderators Posted June 28, 2003 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. Quote Visit...Bassic Software
Faceless Master Posted June 29, 2003 Author Posted June 29, 2003 COol ; Well sounds nice! now is there any relationship between delegates and threading bcoz you can also call functions with delegats???????? Quote Creativity Beyond Imagination http://www.facelessmaster.tk
Moderators Robby Posted June 29, 2003 Moderators Posted June 29, 2003 Delagates are how you would use threading. Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.