M
michdoh
Hi All
I'm looking for some help on creating a basic multi threaded
application.
i'n new to threads in this environment so for test purposes I've
produced a very basic program. (which doesn't work)
Calling the 2 methods directly has the desired effect however when I
try to impelment them as threads nothing happens.
Any help os greatfully recieved.
Mikey
################################################
Private slTimer As New Thread(AddressOf SlowOut)
Private ftTimer As New Thread(AddressOf FastOut)
Private Sub btStart_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btStart.Click
slTimer.Start()
ftTimer.Start()
End Sub
Sub FastOut()
Dim x As Integer = 0
While x < 5
Response.BufferOutput = False
Response.Write("Fast " & x & " " &
AppDomain.GetCurrentThreadId & "<BR>")
Response.Flush()
x += 1
ftTimer.Sleep(200)
End While
End Sub
Sub SlowOut()
Dim i As Integer = 0
While i < 5
Response.BufferOutput = False
Response.Write("Slow" & i & " " &
AppDomain.GetCurrentThreadId & "<BR>")
Response.Flush()
slTimer.Sleep(500)
i += 1
End While
End Sub
##################################################################
I'm looking for some help on creating a basic multi threaded
application.
i'n new to threads in this environment so for test purposes I've
produced a very basic program. (which doesn't work)
Calling the 2 methods directly has the desired effect however when I
try to impelment them as threads nothing happens.
Any help os greatfully recieved.
Mikey
################################################
Private slTimer As New Thread(AddressOf SlowOut)
Private ftTimer As New Thread(AddressOf FastOut)
Private Sub btStart_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btStart.Click
slTimer.Start()
ftTimer.Start()
End Sub
Sub FastOut()
Dim x As Integer = 0
While x < 5
Response.BufferOutput = False
Response.Write("Fast " & x & " " &
AppDomain.GetCurrentThreadId & "<BR>")
Response.Flush()
x += 1
ftTimer.Sleep(200)
End While
End Sub
Sub SlowOut()
Dim i As Integer = 0
While i < 5
Response.BufferOutput = False
Response.Write("Slow" & i & " " &
AppDomain.GetCurrentThreadId & "<BR>")
Response.Flush()
slTimer.Sleep(500)
i += 1
End While
End Sub
##################################################################