A
Armin Zingler
Hi altogether,
this is really strange: How can one busy thread lock the whole machine?
Code: (just for testing!)
Shared Sub Main()
'Process.GetCurrentProcess.PriorityClass = ProcessPriorityClass.RealTime
'Threading.Thread.CurrentThread.Priority = Threading.ThreadPriority.Highest
WaitHeavy(10000)
End Sub
'I know that there is Thread.Sleep() but that's not the point.
Private Shared Sub WaitHeavy(ByVal Milliseconds As Integer)
Dim watch = Stopwatch.StartNew
Do Until watch.ElapsedMilliseconds >= Milliseconds
Loop
End Sub
It does what expected: It keeps one of the three available cores
busy (i.e. 33% total CPU usage) and quits after 10 seconds.
BUT: After uncommenting the two lines, the machine starts
reacting slower and is finally gets locked completely!
If I press Ctrl+Alt+Del, not even the mouse pointer can
be moved anymore. NumLock/CapsLock LEDs can't be switched.
(Maybe you have to change the interval to 30000 to reproduce it.)
On a triple-core??? How comes? I've never seen this before.
After the app quits, everything's back to normal.
(Win7/64 on Athlon II X3, 4 GB RAM)
this is really strange: How can one busy thread lock the whole machine?
Code: (just for testing!)
Shared Sub Main()
'Process.GetCurrentProcess.PriorityClass = ProcessPriorityClass.RealTime
'Threading.Thread.CurrentThread.Priority = Threading.ThreadPriority.Highest
WaitHeavy(10000)
End Sub
'I know that there is Thread.Sleep() but that's not the point.
Private Shared Sub WaitHeavy(ByVal Milliseconds As Integer)
Dim watch = Stopwatch.StartNew
Do Until watch.ElapsedMilliseconds >= Milliseconds
Loop
End Sub
It does what expected: It keeps one of the three available cores
busy (i.e. 33% total CPU usage) and quits after 10 seconds.
BUT: After uncommenting the two lines, the machine starts
reacting slower and is finally gets locked completely!
If I press Ctrl+Alt+Del, not even the mouse pointer can
be moved anymore. NumLock/CapsLock LEDs can't be switched.
(Maybe you have to change the interval to 30000 to reproduce it.)
On a triple-core??? How comes? I've never seen this before.
After the app quits, everything's back to normal.
(Win7/64 on Athlon II X3, 4 GB RAM)