[ Advanced Control and Suspensions | Reference Manual | Alphabetic Index ]
Get the priority of the currently executing goal.
- A variable.
All goals in ECLiPSe execute under a certain priority. An execution
can only be interrupted by the waking of a goal with a higher
priority. Priorities are most relevant in data-driven algorithms,
to specify that certain goals must do their work before others
can meaningfully execute.
Priorities range from 1 (most urgent) to 12 (least urgent). The
toplevel goal of an execution always runs at the lowest priority (12).
Warning: Although it is possible to write programs that only work
correctly under a particular priority ordering, such practice is
strongly discouraged. Priorities should only affect efficiency,
Modes and Determinism
- (24) number expected
- Priority is neither variable nor number.
[eclipse 1]: get_priority(P).
P = 12
[eclipse 2]: [user].
p :- get_priority(P), writeln(prio=P).
user compiled traceable 120 bytes in 0.00 seconds
[eclipse 3]: suspend(p, 5, X->inst), X=1.
prio = 5
X = 1
call_priority / 2, make_suspension / 3, suspend / 3, suspend / 4, set_suspension_data / 3