Re: (sleep)ing for a very short time.
- From: tcarchibald@xxxxxxxxx
- Date: 27 May 2005 21:02:34 -0700
> 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
.
- Follow-Ups:
- Re: (sleep)ing for a very short time.
- From: Frank Buss
- Re: (sleep)ing for a very short time.
- References:
- (sleep)ing for a very short time.
- From: tcarchibald
- Re: (sleep)ing for a very short time.
- From: Kenny Tilton
- (sleep)ing for a very short time.
- Prev by Date: Re: clisp: how stable/usable is the cl-gtk lib ?
- Next by Date: Re: (sleep)ing for a very short time.
- Previous by thread: Re: (sleep)ing for a very short time.
- Next by thread: Re: (sleep)ing for a very short time.
- Index(es):
Relevant Pages
|
Loading