[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

8.0: Timers; Scheduler Sluggishness; Remote Terminal Status Line



    Date: Sat, 09 Jun 90 09:21:27 EDT
    From: rjb1@gte.com

    1.  Is there any way to get a list of pending timers?  The "old
    timers" are still in their queue, but the new ones aren't.  Even with
    the quite lucid documentation of the new scheduler (some Symbolics
    tech writer deserves a pat on the back), and with an apropos of the
    process package, I can't figure out how to examine all the new timers
    to decide whether my nightly utilities are already waiting.  I can map
    over the processes, but how can I get from a process to its timer
    without maintaining my own mapping?

The old timer queue is obsolete and not used by anything in the released
system (unless we missed something), but was left there for
compatibility with existing applications.  Of course, everybody should
convert to using new timers as soon as convenient.

Unfortunately, the logic of the new timer setup is somewhat incompatible
with the old timers, so things have to be recast a little in converting
them.  Also, the essential cliche for examining all the extant timers is
not obvious and not documented by any example.  Here is an example from
one of my 8.0-converted hacks:

  (defun idle-gc-establish-timer ()			;establish timer check at init and warm boot
    (1process::map-heap process::*pending-timers*0	;tear out any existing ones first
		       #'(lambda (ignore ignore timer) 
			   (when (string-equal (process::timer-name timer) "Idle gc")
			     (process:clear-timer timer))))
    (setq *idle-gc-timer* (process:create-timer-call #'idle-gc-top-level () :name "Idle gc"))
    (process:reset-timer-relative *idle-gc-timer* 10.)	; make it run right away
    )

As this example implies, to find a particular timer or type of timer,
you have to know something unique about it, like its name or its
function-to-run.  

In general, there is no universal way to map from a process to its
timer.  If a program needs to keep track of its timer, it needs to hold
onto a handle on the timer.  The example shows that it keeps the
relevant timer object in a global variable.

    These details aside, we're fairly impressed with 8.0.  (My favorite
    feature is that my programs now have the same bugs on the 3600s as
    they did on our MacIvories -- so I can camouflage even my worst
    kludges without the #+IVORY flag.)

Thanks for the endorsement.