comp.lang.ada
 help / color / mirror / Atom feed
From: "Chad R. Meiners" <crmeiners@hotmail.com>
Subject: Re: tasking with GNAT 3.14p on windows
Date: Mon, 31 Mar 2003 23:17:43 -0500
Date: 2003-03-31T23:17:43-05:00	[thread overview]
Message-ID: <b6b445$2q7t$1@msunews.cl.msu.edu> (raw)
In-Reply-To: wcck7ef9bzv.fsf@shell01.TheWorld.com


"Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message
news:wcck7ef9bzv.fsf@shell01.TheWorld.com...
>
> The Ada RM has nothing to say about system calls, so of course they are
> not guaranteed (by the RM) to be abortable.  But I'm very interested in
> what GNAT does with system calls in the presence of abort.  Can you tell
> us what happens if, say, a socket read is aborted?  And if it's not
> abortable, how does one work around that fact?

Ah, such a good question.  The quick answer is that one does not depend on
the use of aborts when doing socket programing ;)  Actually according to
winsock if you close the socket while another task is block on it waiting
for a read it will return a from the read function with an error.  So if you
want to shutdown you socket servers close your sockets and then abort your
tasks.

> Or suppose one task does a socket read, and another task gets aborted.
> How well does that work?  On windows, I mean.  Assume polling is turned
> on.

This works well since the tasks are mapped to native threads so the other
thread is free to poll away for the abort.  Now I must say I am by no means
an expert on the gnat compiler; my source diving has been limited to the
parser and the Text_IO implementation.  My information on tasking is based
on empirical experience, the gnat documentation and a few comments I think I
remember Dr. Dewar making on CLA ;)

-CRM





  reply	other threads:[~2003-04-01  4:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-30 18:49 tasking with GNAT 3.14p on windows Bernd Specht
2003-03-30 20:19 ` James S. Rogers
2003-03-30 22:14   ` Jano
2003-03-31  2:53     ` James S. Rogers
2003-03-31  6:32       ` James S. Rogers
2003-03-31  6:56       ` Sergey Koshcheyev
2003-03-31  9:00         ` 
2003-03-31 19:09       ` Bernd Specht
2003-03-31 18:14     ` Chad R. Meiners
2003-03-31 21:08       ` Jano
2003-03-31  7:57 ` 
2003-03-31  9:30   ` Ole-Hjalmar Kristensen
2003-03-31 17:58     ` Jano
2003-03-31 18:30       ` Chad R. Meiners
2003-03-31 22:16         ` Jano
2003-03-31 23:09           ` Chad R. Meiners
2003-03-31 23:44           ` Chad R. Meiners
2003-04-01 12:17             ` Jano
2003-04-01  2:40         ` Robert A Duff
2003-04-01  4:17           ` Chad R. Meiners [this message]
2003-04-01  6:25             ` Jano
2003-04-01 15:33               ` Pascal Obry
2003-04-01  8:42           ` Dmitry A. Kazakov
2003-04-02 13:35             ` Alfred Hilscher
replies disabled

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