I am using VB.NET 2005. My program receives messages, and for every message
I create a thread.
Say I received Message 1, spawn the thread, then receive Message 2, spawn
the thread.
Even though I spawn the Message1 thread before Message2 thread, sometimes
Message 2 thread is executed before Message 1 thread.
Is there a way for me make sure Thread1 is executed before Thread2 ?
Thank you.
newmessage$ = "....."
Dim clsEachMessage As New EachMessage
clsEachMessage. Packet = newmessage
If threadCount 100 Then threadCount =
0
threadCount += 1
clsEachMessage. threadCount = threadCount
EachMessageThre ad = New
Threading.Threa d(AddressOf clsEachMessage. ProcessMessage)
EachMessageThre ad.Name = "Thread " &
threadCount.ToS tring()
EachMessageThre ad.Start()
Thread.Sleep(0)
I create a thread.
Say I received Message 1, spawn the thread, then receive Message 2, spawn
the thread.
Even though I spawn the Message1 thread before Message2 thread, sometimes
Message 2 thread is executed before Message 1 thread.
Is there a way for me make sure Thread1 is executed before Thread2 ?
Thank you.
newmessage$ = "....."
Dim clsEachMessage As New EachMessage
clsEachMessage. Packet = newmessage
If threadCount 100 Then threadCount =
0
threadCount += 1
clsEachMessage. threadCount = threadCount
EachMessageThre ad = New
Threading.Threa d(AddressOf clsEachMessage. ProcessMessage)
EachMessageThre ad.Name = "Thread " &
threadCount.ToS tring()
EachMessageThre ad.Start()
Thread.Sleep(0)
Comment