Subject: Re:SIGINT

From: Jan Wielemaker <[email-masked]>
Date: Mon, 5 Jun 2000 16:30:55 +0200

On Mon, 05 Jun 2000, VIOLLET Frederic wrote:

>Thank yo for all your answers, but I can't get on_signal to work
>I don't understand how to link a signal to a predicate I have written.

For example:

on_int(X) :-
        format('Received signal ~w~n', [X]).

:- on_signal(int, _, on_int).

Load this and type Control-C and it will print
"Received signal int" on each Control-C it gets.  But:

	* Somehow this doesn't work correctly in plcon.exe
	  (Windows console toplevel).
	* plwin.exe doesn't use interrupts at all.  Typing
	  Control-C sets a flag that is tested on each
	  predicate call.  Currently this cannot be redefined
	  (but if you give me a good reason I will have a
	  look what can be done).

For short, on_signal makes very little sence on Windows.  On
Unix it works fine, though most likely there are still a few
places where signals need to be deferred.  This implies that
using signals intensively for inter-process communication in
critical applications is not adviced.

	Regards --- Jan