Naming Threads
Name spaces to be used are
System.Threading
Names can be provided for threads
Imports System.Threading
Class workerclass
Public Sub dosomework()
Console.WriteLine("secondary thread:")
Dim i As Integer
For i = 0 To 10
Console.WriteLine(i & ",")
Next
Console.WriteLine()
End Sub
End Class
Module Module1
Sub Main()
Dim primarythread As Thread = Thread.CurrentThread
primarythread.Name = "BOSS"
Console.WriteLine("primary thread..")
Dim w As workerclass = New workerclass()
Dim backgroundthread As Thread = New Thread(AddressOf w.dosomework)
backgroundthread.Name = "secondary thread"
backgroundthread.Start()
End Sub
End Module
Explanation: just for clarity we use names for threads which can be achieved through name property.
