Forum > GPU crunching

Sleeping for less than 1ms in Windows - is it possible and how?

<< < (4/5) > >>

Raistmer:
Though initial goal looks unreachable I would like to collect here some useful info about windows time slices management.

This utility: http://technet.microsoft.com/en-us/sysinternals/bb897568
gives this result for my dev netbook:

C:\bin>Clockres.exe


ClockRes v2.0 - View the system clock resolution
Copyright (C) 2009 Mark Russinovich
SysInternals - www.sysinternals.com

Maximum timer interval: 15.600 ms
Minimum timer interval: 0.500 ms
Current timer interval: 1.000 ms

It could explain why I did not see any changes when used timeBeginPeriod(1); inside app.
What about yours PCs ? What value they use ?

WinXP AthlonXP, no GPGPU-enabled GPU inside:
Maximum timer interval: 15.625 ms
Minimum timer interval: 1.000 ms
Current timer interval: 15.625 ms

Raistmer:

--- Quote from: Urs Echternacht on 31 Oct 2013, 06:02:51 pm ---Read your own reference from first post a little bit more detailed. That person solved the problem of 100% CPU activity by combining QueryPerformanceCounters() with Sleep(0) and some other little tricks.

And, by the way, if it is possible to reduce the "active" wait time to some fraction of a millisecond, wouldn't that reduce the totals CPU and elapsed time, too ?

--- End quote ---

Sleep(0) in high-priority thread (and our worker GPU thread have higher priority than worker thread in CPU app) should "return" to higher priority thread, not to idle-priority CPU thread. So, with Sleep(0) we "make call" to OS scheduler, scheduler looks at current situation, sees GPU thread non-blocked, sees CPU thread non-blocked too but with idle priority and decides to run GPU thread again. Maybe I'm wrong though about GPU thread state that will be after calling Sleep(0).

Raistmer:
ooops... more to CPU BOINC apps but should be known:


--- Quote ---Note that the threads part of a process running in the idle process priority class always receive a
single thread quantum (2 clock ticks), ignoring any sort of quantum configuration settings, whether
set by default or set through the registry.
--- End quote ---
(Windows Internals, 6-th edition, part 1, p. 428)

This means that running ALL BOINC CPU applications as idle-priority class processes we deliberately degrade their performace! Even on dedicated crunchers OS will have to make scheduling decisions much more often than it could do for non-idle priority classes, especially on server OS.

Josef W. Segur:

--- Quote from: Raistmer on 09 Nov 2013, 07:18:18 am ---Though initial goal looks unreachable I would like to collect here some useful info about windows time slices management.

This utility: http://technet.microsoft.com/en-us/sysinternals/bb897568
...
--- End quote ---

Windows 7 SP1 x64, AMD A10-4600M quad core system:

ClockRes v2.0 - View the system clock resolution
Copyright (C) 2009 Mark Russinovich
SysInternals - www.sysinternals.com

Maximum timer interval: 15.600 ms
Minimum timer interval: 0.500 ms
Current timer interval: 15.600 ms



Windows 2000 SP4, Pentium-M single core system:

ClockRes v2.0 - View the system clock resolution
Copyright (C) 2009 Mark Russinovich
SysInternals - www.sysinternals.com

Maximum timer interval: 10.014 ms
Minimum timer interval: 1.003 ms
Current timer interval: 10.014 ms

                                                   Joe

mr.mac52:
Windows 7 SP1 x64 Core 2 Quad Q9300 @2.5GHz

ClockRes v2.0 - View the system clock resolution
Copyright (C) 2009 Mark Russinovich
SysInternals - www.sysinternals.com

Maximum timer interval: 15.600 ms
Minimum timer interval: 0.500 ms
Current timer interval: 1.000 ms

Windows 7 SP1 x64 Core i7-4770K @3.5GHz

ClockRes v2.0 - View the system clock resolution
Copyright (C) 2009 Mark Russinovich
SysInternals - www.sysinternals.com

Maximum timer interval: 15.600 ms
Minimum timer interval: 0.500 ms
Current timer interval: 1.000 ms

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version