It seems that many don't have a firm grasp on multi-threading. I'll be covering across a series of several lessons almost all the facets of multi-threading. I'll start off with a definition of multi-threading and then I'll show the basic functions available in the APIs before I move on to the more advanced types.
Firstly, a good definition of Multi-Threading is :
"it is easy to confuse multi-threading with multitasking or multiprogramming, which are somewhat different ideas.
Multi-threading is the ability of a program or an operating system
process to manage its use by more than one user at a time and to even manage multiple requests by the same user without having to have multiple copies of the program running in the computer. Each user request for a program or system service (and here a user can also be another program) is kept track of as a thread with a separate identity. As programs work on behalf of the initial request for that thread and are interrupted by other requests, the status of work on behalf of that thread is kept track of until the work is completed. " (from WhatIs.com)
At the heart of Multi-Threading (from the .NET framework's perspective) we have the System.Threading.Thread class. This class allows us to create a new thread which would operate in parallel to the main application thread that spawned (created) it. An extremely simple use could be as follows:
Imports System.Threading
Module modStart
'entry point of the Console Application
Sub Main()
Dim thread As New Thread(AddressOf clsWork.DoWork)
thread.Start()
'do primary thread work
End Sub
End Module
'Class that does the work on the spawned thread
Class clsWork
Shared Sub DoWork()
'Do spawned thread work
End Sub
End Class
Obviously, this particular example does absolutely nothing, but it shows the basic way of creating and starting a thread. This particular method call does not pass along any new thread parameters and it is very minimalist in providing information about the thread and its functionality. You can find a fully functioning and well documented example solution right here. Keep in mind, this solution only shows the basics of creating a new thread and it is only a guideline.
Tomorrow, I'll be showing you how to create background threads and how they're useful for running long running tasks such as I/O.
Mustafa Ismail

2 comments:
Medication Foundation hot news
http://www.physictherapy.com/ - finasteride 5mg
The good news is that if you or someone you know is suffering from hair loss there is a medication called Propecia that has helped thousands of men begin regrowing their hair.
[url=http://www.physictherapy.com/]generic propecia[/url]
The good news is that if you or someone you know is suffering from hair loss there is a medication called Propecia that has helped thousands of men begin regrowing their hair.
propecia without prescription
Propecia's mechanism of action works by preventing the conversion of testosterone to dihydrotestosterone (DHT) in the body.
http://www.girlevolution.com/ - isotretinoin price
Doing so will prevent the capsule from melting in your food pipe which may cause irritation.
[url=http://www.girlevolution.com/]buy accutane[/url]
You may buy your refill from several trusted online pharmacies.
cheap accutane
If you have been suffering from the menace of acne, or even harsher versions of it such as Nodular or Cystic acne then you should look into a medication known as Accutane.
Walgreen Drug Prices http://www.tenthousandvillagesid.com/ - xanax online no prescription Chewing of the drug should be avoided by all means. [url=http://www.tenthousandvillagesid.com/]alprazolam no prescription[/url]
Post a Comment