Jump to content

Engine (computer science)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 203.51.161.109 (talk) at 06:02, 15 April 2012 (Undid revision 485455408 by Hackers8968 (talk)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

An engine is a continuation-based construct that provides timed preemption. Engines which can contain other engines are sometimes called Nesters and engines which don't have this ability are then called flat engines or "solo engines" . To implement timed preemption there needs to be a clock. This clock can measure real time or simulated time. Simulated time can be implemented in a language like Scheme, by making each function start with decrementing the clock.

(define-syntax timed-lambda
    ((_ formals exp1 exp2 ...)
     (lambda formals (decrement-timer) exp1 exp2 ...))))