Multithreading gives programs the ability to do several things at a time. Each stream of execution is called a thread. Multithreading is used to divide lengthy tasks into different segments that would otherwise abort programs. Threads are mainly used to utilize the processor to a maximum extent by avoiding it's idle time. Threading lets a program seem as if it is executing several tasks at once. What actually happens is, the time gets divided by the computer into parts and when a new thread starts, that thread gets a portion of the divided time. Threads in VB .NET are based on the namespace System.Threading.
Source: StartVBDotNet
-----------------------------------------------
Adding a bit of my knowledge:
So basically, you can do multiple things at once using this. A backgroundworker is nothing more than a multithread as a control. Let's say you are trying to connect to a database. This will for sure take 2-4 seconds(unless it is localhost you are connecting to).
Button_Click
[php]Try
conn.open
conn.close
Catch ex as mysqlexception
end try[/php]
Now, this would freeze the application while it is trying to connect. To avoid this freezing and to run even more subs/actions at the same time, you can use multithreading or backgroundworker.
We create a sub for what we want to do:
[php]Private Sub Connect
Try
conn.open
conn.clse
Catch ex as mysqlexception
end try
End sub[/php]
Button_Click
[php]dim t as new threading.thread(addressof Connect)
t.start
'Further Code[/php]
The application will not freeze and your further code will be executed after the thread is started, not when the tread is done
As you see, multithreading can come in very handy. Especially in larger progresses.