Next: Networking, Previous: Threading, Up: Top
SBCL supports a system-wide scheduler implemented on top of
setitimer that also works with threads but does not require a
separate scheduler thread.
(schedule-timer (make-timer (lambda ()
(write-line "Hello, world")
(force-output)))
2)
Class precedence list:
timer, structure-object, tTimer type. Do not rely on timers being structs as it may change in future versions.
Create a timer object that's when scheduled runs
function. Ifthreadis a thread then that thread is to be interrupted withfunction. Ifthreadistthen a new thread is created each timerfunctionis run. Ifthreadisnilthenfunctioncan be run in any thread.
See if
timerwill still need to be triggered afterdeltaseconds from now. For timers with a repeat interval it returns true.
Schedule
timerto be triggered attime. Ifabsolute-pthentimeis universal time, but non-integral values are also allowed, elsetimeis measured as the number of seconds from the current time. Ifrepeat-intervalis given,timeris automatically rescheduled upon expiry.