Test 1: All threads with normal priority
Starting test with duration: 3 seconds
Thread priorities: Sleep(0)=Normal(0), Sleep(1)=Normal(0), SwitchToThread=Normal(0)
Results:
Sleep(0) iterations: 3325126
Sleep(1) iterations: 1511
SwitchToThread iterations: 3475552
Test 1.1: All threads with normal priority
Starting test with duration: 1 seconds
Thread priorities: Sleep(0)=Normal(0), Sleep(1)=Normal(0), SwitchToThread=Normal(0)
Results:
Sleep(0) iterations: 1113996
Sleep(1) iterations: 504
SwitchToThread iterations: 1164189
Test 1.5: All threads with normal priority
Starting test with duration: 5 seconds
Thread priorities: Sleep(0)=Normal(0), Sleep(1)=Normal(0), SwitchToThread=Normal(0)
Results:
Sleep(0) iterations: 5517579
Sleep(1) iterations: 2521
SwitchToThread iterations: 5767000
Test 2: Different priorities
Starting test with duration: 5 seconds
Thread priorities: Sleep(0)=Higher(1), Sleep(1)=Normal(0), SwitchToThread=Lower(-1)
Results:
Sleep(0) iterations: 5424269
Sleep(1) iterations: 2517
SwitchToThread iterations: 5672785
Test 3: Different priorities
Starting test with duration: 5 seconds
Thread priorities: Sleep(0)=Lowest(-2), Sleep(1)=Highest(2), SwitchToThread=Normal(0)
Results:
Sleep(0) iterations: 5372945
Sleep(1) iterations: 2519
SwitchToThread iterations: 5648329
Test 4: Different priorities
Starting test with duration: 5 seconds
Thread priorities: Sleep(0)=Lowest(-2), Sleep(1)=Lowest(-2), SwitchToThread=Lowest(-2)
Results:
Sleep(0) iterations: 5533097
Sleep(1) iterations: 2518
SwitchToThread iterations: 5778718
Done.
Starting starvation test with Sleep(0), Consumer=Normal(0), Producer=Normal(0)
Result: Sleep(0) time: 0 ms
Starting starvation test with Sleep(0), Consumer=Normal(0), Producer=Lower(-1)
Result: Sleep(0) time: 0 ms
Starting starvation test with Sleep(0), Consumer=Lower(-1), Producer=Normal(0)
Result: Sleep(0) time: 0 ms
Starting starvation test with Sleep(1), Consumer=Normal(0), Producer=Normal(0)
Result: Sleep(1) time: 0 ms
Starting starvation test with Sleep(1), Consumer=Normal(0), Producer=Lower(-1)
Result: Sleep(1) time: 0 ms
Starting starvation test with Sleep(1), Consumer=Lower(-1), Producer=Normal(0)
Result: Sleep(1) time: 0 ms
Starting starvation test with SwitchToThread, Consumer=Normal(0), Producer=Normal(0)
Result: SwitchToThread time: 0 ms
Starting starvation test with SwitchToThread, Consumer=Normal(0), Producer=Lower(-1)
Result: SwitchToThread time: 0 ms
Starting starvation test with SwitchToThread, Consumer=Lower(-1), Producer=Normal(0)
Result: SwitchToThread time: 0 ms
Done.
Intel Core i5-9500 3.00 GHz, Windows 11 Pro 24H2