This began as a private inquire; Nikodemus agreed to move it to the
Nikodemus Siivola <nikodemus@...> writes:
> 2010/1/14 Tobias C. Rittweiler <tcr@...>:
> > I find it irritating that
> > (sb-sys:with-deadline (:seconds 0.5) (sb-sys:serve-all-events 1))
> > works just fine, but
> > (sb-sys:with-deadline (:seconds 0.5) (sleep 1))
> > "does not".
> > Why do you think this is how it should be done?
> I'm not particularly opposed to SLEEP calling DECODE-TIMEOUT to check
> for deadlines. (DECODE-TIMEOUT signals the deadline if it has already
Ok; DECODE-TIMEOUT won't take *PERIODIC-POLLING-FUNCTION* into account
but I _could_ live with it if at least deadlines are shot.
I'm not experienced with the serve-event framework, and how it
internally hooks into SBCL's I/O routines.
What additional surprises may there be when SLEEP does not hook into
> I'm less enhtused about generally recursing into SERVE-EVENT from
> SLEEP: I think one of the more important guarantees of SLEEP is that
> it won't take significantly longer than it is supposed to. SLEEP
> returning immediately is problematic than SLEEP taking an order of
> magnitude longer than it is supposed to.
I'm not sure about that. I can only speak for myself of course, but I
did expect that invoking SLEEP means giving rise to the Lisp scheduler
-- and if I was looking for a way to become dormant for a very precise
amount of time, I'd have looked/asked for a specific means.
I.e. I'd have expected it the other way around as it currently is, or
tries to be (SLEEP trying to be precise, and I have to look for a
different means for dormance+scheduling [SERVE-ALL-EVENTS].)
What do others think about this?
Perhaps there should be a :PRECISE key parameter to SLEEP?