comp.lang.ada
 help / color / mirror / Atom feed
From: Craig Carey <research@ijs.co.nz>
Subject: Re: Terminating a task
Date: Mon, 14 Jul 2003 21:34:58 +1200
Date: 2003-07-14T21:34:58+12:00	[thread overview]
Message-ID: <ubs4hv4eaar8hbmr2vut59ananvsuvra9a@4ax.com> (raw)
In-Reply-To: bep6ev$qko$1@news.onet.pl


On Sat, 12 Jul 2003 16:03:27 +0200, "kat-Zygfryd" <6667@wp.pl> wrote:
>If I have a task running Get_Line (from an AdaSocket)
>how can I terminate this task from within another task?
>Simply shutting down the socket doesn't work as
>the thread is interrupted by an exception only when
>there is data sent from the client attached to the socket.

On Sat, 12 Jul 2003 16:37:09 +0200, "kat-Zygfryd" <6667@wp.pl> wrote:
>I tried to use Abort_Task but the whole program
>terminates with a message that the environment task


If a task is blocked on a socket then either close that socket or
shutdown the TCP stack.

This text would not be correct if the source code was rewritten: "Simply
shutting down the socket doesn't work as ... "

PS. With GNAT 3.15 in Linux/etc., to get Ctrl-C running safely, user-
side code is written to unblock all blocking statements in tasks.


------------

PS. The new "Computer Language Shootout" website now has Ada. 

   http://dada.perl.it/shootout/index.html

GNAT Ada came first of 32 entries in one OO speed test

   http://dada.perl.it/shootout/methcall.html

My "wc" word count program got eliminated probably since the tester
could not link in Win32 "_setmode" and "_read". (Ada 95 packages do not
allow accurate reading from the standard input). At least 3 of the Ada
examples vanished (including a regular expressions example), probably
for having too many lines in a package (strings, hashes).

Some C programmers decided to have their 'sumcol' entries pick the
first number when a line contained 2 numbers and it seemed incorrect:

   http://dada.perl.it/shootout/sumcol.html


Craig Carey

--------------------------

How To Cross-Compile to a Linux target while compiling in a FreeBSD 5
host. Some new instructions are here:
http://www.ijs.co.nz/code/ada95-freebsd-to-linux-cross-compiler.txt






  reply	other threads:[~2003-07-14  9:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-12 14:03 Terminating a task kat-Zygfryd
2003-07-12 14:37 ` kat-Zygfryd
2003-07-14  9:34   ` Craig Carey [this message]
2003-07-14 23:45     ` Matthew Heaney
2003-07-15 17:49       ` Craig Carey
2003-07-15 18:30         ` David C. Hoos
2003-07-16  5:26         ` Matthew Heaney
2003-07-15 22:37       ` Robert I. Eachus
2003-07-16  5:00         ` Matthew Heaney
2003-07-16 18:19           ` Robert I. Eachus
replies disabled

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