[GAP] Deferred task aborting and get_immediate

Arnaud Charlet charlet at adacore.com
Wed Sep 6 16:22:46 CEST 2006


> When the task below is blocked in get_immediate, it can not be aborted 
> using the statement "abort TacheEcouteClavier" : aborting the task is 
> deferred until get_immediate returns.
> 
> Is this a feature of the language or a particularity of Gnat 
> implementation ?

It's a feature of the OS and depends also on the GNAT run-time used
(e.g default or rts-sjlj).

If using --RTS=sjlj under Linux, the GNAT run-time will attempt to
asynchronousely abort the get_immediate, although this may let your
application in an unstable state, see below.

Note that it's in any case a bad idea to try to abort asynchronousely this
kind of operation (in this case a system I/O call) since there is no way
in general to ensure proper clean up or system calls.

It's in general far preferable to use an explicit "manual" abort mechanism
via e.g. a rendezvous.

Arno


More information about the GAP mailing list