comp.lang.ada
 help / color / mirror / Atom feed
From: "Peter Hend�n" <phenden@tdab.com>
Subject: Re: asynchronos select question
Date: Thu, 25 Oct 2001 23:30:22 GMT
Date: 2001-10-25T23:30:22+00:00	[thread overview]
Message-ID: <ig1C7.2344$R43.409545@newsb.telia.net> (raw)
In-Reply-To: 9r8nmb$l2j$1@e3k.asi.ansaldo.it

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1264 bytes --]

"Paolo Argenton" wrote:
<snip>
> select
>     delay 5.0;
>     put_line (" timeout" );
> then abort
>     proc_with_blocking_io; -- i.e. wait for a byte to come from a serial
> line for istance
> end select;

> it never triggers the timeout part and waits forever, at least on NT+gnat
> 3.13. Is it correct ? incorrect ? my misunderstanding ? compiler/OS
> dependant code ?
Check out "pragma Polling" in the GNAT Reference Manual and the switch
-gnatP in the User's Guide. An asynchronous abort will not work at all under
NT without pragma polling (ON).

In this particular case it will not work correctly (at least not under NT)
anyway. The blocking_io call is "outside the reach" of Ada, since
no polling can take place with the process blocked in I/O.

If you replace the blocking io call with a very time-consuming calculation,
it will work just fine with Polling (ON) but not with (OFF) - the default.

Just a question to those who might know. Is this behaviour conforming
to the standard? I can see no reason in the ARM for not being able
to abort a blocking io operation. Does it work on other platforms?

Regards,
Peter H.

--
Peter Hend�n           http://www.algonet.se/~phenden
ICQ: 14672398
Teknisk Dokumentation AB          http://www.tdab.com






  parent reply	other threads:[~2001-10-25 23:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-25  9:54 asynchronos select question Paolo Argenton
2001-10-25 18:57 ` Ted Dennison
2001-10-25 23:30 ` Peter Hend�n [this message]
2001-11-02  4:17   ` David Brown
2001-11-02 11:15   ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox