next up previous index
Next: Suspend Solver Up: Advanced Control Features Previous: Waking conditions for suspensions   Index


The Waking Mechanism

Suspended goals are woken by submitting at least one of the suspension lists in which they occur to the waking scheduler. The waking scheduler which maintains a global priority queue inserts them into this queue according to their priority (see figure 17.1).

A suspension list can be passed to the scheduler by either of the predicates schedule_suspensions/1 or schedule_suspensions/2. A suspension which has been scheduled in this way and awaits its execution is called a scheduled suspension.

Note, however, that scheduling a suspension by means of schedule_suspensions/1 or schedule_suspensions/2 alone does not implicitly start the waking scheduler. Instead, execution continues normally with the next goal in sequence after schedule_suspensions/1,2. The scheduler must be explicitly invoked by calling wake/0. Only then it starts to execute the woken suspensions.

The reason for having wake/0 is to be able to schedule several suspension lists before the priority-driven execution begins 17.1.


next up previous index
Next: Suspend Solver Up: Advanced Control Features Previous: Waking conditions for suspensions   Index
Warwick Harvey
2004-08-07