Next: Events
Up: ECLiPSe User Manual Release
Previous: Definite Clause Grammars
  Index
Events and Interrupts
The normal execution of a Prolog program may be interrupted by
Events and Interrupts:
- Events
-
- they may occur asynchronously (posted by the environment)
or synchronously (raised by the program itself).
- they are handled synchronously by a handler goal that is inserted
into the resolvent.
- the handler can interact with interrupted execution via
global references.
- the handler can cause the interrupted execution to fail or to abort.
- the handler can cause waking of delayed goals.
- Errors
-
Errors are a special case of events. They are raised by built-in
predicates (e.g. when the arguments are of the wrong type)
and usually pass the culprit goal to the error handler.
- Interrupts
-
Interrupts usually originate from the operating system, e.g. on a Unix
host, signals are mapped to ECLiPSe interrupts.
- they occur asynchronously, but may be mapped into a sychronous event.
- in Unix, the handler can be executed asynchronously in a separate
ECLiPSe engine. This means that
- the handler cannot interact with interrupted execution, except via
global variables, files and the like.
- failure of the handler is ignored.
- the development system catches and handles many operating system
signals as interrupts, user abort by typing
^
C,
data arriving at sockets, memory protection faults, etc.
Next: Events
Up: ECLiPSe User Manual Release
Previous: Definite Clause Grammars
  Index
Warwick Harvey
2004-08-07