Create Threads : Thread Create « Thread « VB.Net Tutorial






Module Module1

    Sub TaskA()
        Dim I As Integer

        For I = 0 To 250
            System.Console.Write("A")
        Next
    End Sub

    Sub TaskB()
        Dim I As Integer

        For I = 0 To 250
            System.Console.Write("B")
        Next
    End Sub

    Sub TaskC()
        Dim I As Integer

        For I = 0 To 250
            System.Console.Write("C")
        Next
    End Sub

    Sub Main()
        Dim A As System.Threading.Thread = New Threading.Thread(AddressOf TaskA)
        Dim B As System.Threading.Thread = New Threading.Thread(AddressOf TaskB)
        Dim C As System.Threading.Thread = New Threading.Thread(AddressOf TaskC)

        A.Start()
        B.Start()
        C.Start()
    End Sub

End Module
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBACCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAAAAAA"








23.1.Thread Create
23.1.1.Create Threads
23.1.2.Create two threads
23.1.3.Read a file in a thread
23.1.4.Creating and using a ParameterizedThreadStart delegate with a static method and an instance method.