Hi Matt,
I think the answer is NO. Even the thread A is sleepting the other threads
it creates will not sleep and will continue running.
In windows platform the thread is a kernel object too, the OS allots the
CPU time based on threads, that is to say the OS schedule algorithm will
decide which thread will own CPU time for an assignment unit. Thread A is
sleeping will not impact thread B created in Thread A to sleep too.
Imports System.Threading
Module Module1
Dim bFlag As Boolean = True
Public Sub ThreadProc()
While bFlag
Console.WriteLine(Threading.Thread.CurrentThread.Name + "is
running...")
End While
End Sub
Public Sub StrartupThreadProc()
For i As Integer = 0 To 4
Dim td As New Thread(AddressOf ThreadProc)
td.Name = "Sub Thread" + i.ToString()
td.Start()
Next
Thread.Sleep(5000)
bFlag = False
End Sub
Sub Main()
Dim thread1 As New Thread(AddressOf StrartupThreadProc)
thread1.Name = "First Thread"
thread1.Start()
'wait for thread1 exit
thread1.Join()
End Sub
End Module
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.