From jan@swi.psy.uva.nl  Mon Jun  5 16:40:04 2000
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id QAA17563;
	Mon, 5 Jun 2000 16:40:04 +0200 (MET DST)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id QAA29218;
	Mon, 5 Jun 2000 16:40:39 +0200
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: VIOLLET Frederic <viollet@ensicaen.ismra.fr>, prolog@swi.psy.uva.nl
Subject: Re:SIGINT
Date: Mon, 5 Jun 2000 16:30:55 +0200
X-Mailer: KMail [version 1.0.28]
Content-Type: text/plain
References: <Pine.A41.4.05.10006051058420.33040-100000@ibm580.ensicaen.ismra.fr>
In-Reply-To: <Pine.A41.4.05.10006051058420.33040-100000@ibm580.ensicaen.ismra.fr>
MIME-Version: 1.0
Message-Id: <00060516403901.28540@gollem>
Content-Transfer-Encoding: 8bit

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

