Threads
Threads:
Module threads
Sub main()
Dim t1 As Threading.Thread
Dim t2 As Threading.Thread
Dim t3 As Threading.Thread
t1 = New Threading.Thread(AddressOf laufA)
t2 = New Threading.Thread(AddressOf laufB)
t3 = New Threading.Thread(AddressOf laufC)
t1.Start() : t2.Start() : t3.Start()
t1.Join() : t2.Join() : t3.Join()
End Sub
Sub laufA()
Dim i As Integer
For i = 0 To Integer.MaxValue
If 0 = i Mod 10000 Then
Console.Write("X")
End If
Next
End Sub
Sub laufB()
Dim i As Integer
For i = 0 To Integer.MaxValue
If 0 = i Mod 10000 Then
Console.Write("I")
End If
Next
End Sub
Sub laufC()
Dim i As Integer
For i = 0 To Integer.MaxValue
If 0 = i Mod 10000 Then
Console.Write("_")
End If
Next
End Sub
End Module
|