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:
- Interrupts
-
Interrupts usually originate from the operating system, e.g. on a Unix
host, signals are mapped to ECLiPSe interrupts.
- they occur asynchronously
- the handler is 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.
- interrupt handlers are not available in embedded ECLiPSe systems
- 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.
- 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.
Next: Events
Up: ECLiPSe User Manual Release
Previous: Definite Clause Grammars
  Index
1999-08-06