Re: (sleep)ing for a very short time.



> No, you are misreading the TIME output. Look at what it says: "cpu
> time", "non-gc" and "gc". Then the total of those two. GC means time
> spent doing GC, non-GC is the time spent executing your code. Right, ACL
> burns CPU cycles when you sleep.

Actually, I was looking at "; real time 10,093 msec "
The "; cpu time (non-gc) 10,094 msec user, 0 msec system " is
incorrect, and an apparent problem in ACL 5.0.1. In later versions of
ACL (7.0 anyways), doing this same call will result in "; cpu time
(non-gc) 0 msec user, 0 msec system " but real time still shows around
10000msec.
When I say it takes no CPU time, I'm also looking at Windows' task
manager.
The second call, where i'm sleeping for 0.05 seconds, results in a CPU
spike to 100% until it's done.

> Why is it a problem? Why do you want to pause the app? When should the
> app resume? Just fishing...

Fishing's good. The reason it's a problem is two-fold. For one, I want
my program to continue to loop at roughly the same speed even as
computer power increases. The loop may execute the code faster (the
time is already negligable), but the overall program will still tick
along at the same pace.
For two, I don't want the CPU hitting 100% because I have a UI to draw,
and Windows doesn't seem to update the UI very well when Lisp is
continuously sucking up all the CPU time.

Also, to Espen:
I looked into lisp-sleep, but it's effectively the same as sleep, so I
suspect it has the same problem. And besides that, I have other
processes running that I didn't want to sleep. Drat. :/

I've been talking to others about it and I hear there is two timers in
Windows, one has a much finer granularity. So I'm guessing that the
sleep command is hooked into the less-fine timer and can only go as low
as about 0.07secs. My next thought is to try and hook into the windows
timer directly providing there is one that is finer granularity than
0.07secs.
Hrmmm.

Frustrating this one is...
Toron

.



Relevant Pages

  • Re: processor time allocation
    ... When an app is doing IO it does NOT show up in the task manager as process ... simply stating that my process is not getting cpu time really doesn't give ... > perfectly fine using Sleep to obtain a near 20 Hz frequency. ... > Which is that my App is CPU starved and windows wont give my app more than ...
    (microsoft.public.vc.mfc)
  • Re: Re-entrancy???
    ... Sleep calls will just slow the application down. ... Whether or not PeekMessage is occuring in DoEvents ... has no impact on the overall CPU utilization. ... correctly, using the timeXXXX-APIs. ...
    (microsoft.public.vb.general.discussion)
  • Re: cpufreq est and Enhanced Sleep (Cx) States for Intel Core and above
    ... Adam McDougall wrote: ... >> Another thing I wish could work is the Enhanced cpu Sleep States; ... The major reason being that the acpi cpu> driver does not support well multiprocessor systems. ... I've not updated the patch since then so> it might or might not apply cleanly to a recent current. ...
    (freebsd-current)
  • Re: cpufreq est and Enhanced Sleep (Cx) States for Intel Core and above
    ... > Another thing I wish could work is the Enhanced cpu Sleep States; ... > this Dell Latitude D820 laptop only sees C1 although the document ... > acpi stuff and/or verbose boot logs if it would be helpful. ...
    (freebsd-current)
  • Re: System sleep
    ... > is not so CPU intensive to perform a sleep. ... > to finish and moves the file before PGP can decrypt it... ... > VBScript is not my primary language, I use VBScript exclusively in DTS ...
    (microsoft.public.scripting.vbscript)

Loading