comp.lang.ada
 help / color / mirror / Atom feed
From: "Warren W. Gay VE3WWG" <ve3wwg@cogeco.ca>
Subject: Re: stupid question: how can I finish a program?
Date: Sat, 17 Aug 2002 10:26:13 -0400
Date: 2002-08-17T10:26:13-04:00	[thread overview]
Message-ID: <3D5E5D05.4040806@cogeco.ca> (raw)
In-Reply-To: ajivnl$1d$1@nh.pace.co.uk

Marin D. Condic wrote:
...
> Since you can already raise an exception to terminate a given thread and you
> can do various other forms of task termination and you have a variety of
> ways of dealing with finalization, etc. I don't really see any need to
> re-address these things in any new language feature. The one thing you can't
> do is shoot any arbitrary Ada program square in the head from anywhere in
> the code and shut it down totally no matter what state it is in. 

Actually this same situation does come up at the operating system level
(UNIX anyway) at times. Imagine a process that is writing out a tape,
but the tape unit is hung up because of tape I/O errors (or driver bug),
or waiting a tape change etc.,
and you try to kill the process doing the tape write. The process stays
there, because control is still stuck within the kernel.

So some "smart aleck"
comes along and does a kill -9 on it, and this eliminates the process
alright -- but now the tape drive is dead until the next kernel reboot
(because the driver state is now all messed up).
This is an actual past experience I used to have with a SCO UNIX
platform, and that "smart aleck" was me ;-)

The basic message (besides avoiding kill -9) is that there will
always likely be situations where
stopping a process, task, or whatever is not always
immediately possible, without some "cost" associated with it.

In Windows, if you have opened some COM/DCOM objects and referenced
their various interfaces etc., by killing off the process/thread
prematurely will leave the referenced
COM objects referenced. Unlike UNIX where there is a SEM_UNDO
for semaphores, there is no such recovery under the M$ regime.
Those COM/DCOM objects and interfaces stay referenced until the
next reboot -- not a good thing for servers.

I guess what I am suggesting is that it is better to build in a shutdown
protocol, to keep things sane, than it is to rely on a "nuke-em" type
of approach.
-- 
Warren W. Gay VE3WWG
http://home.cogeco.ca/~ve3wwg




  reply	other threads:[~2002-08-17 14:26 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c923f575.0208130627.479e0b3d@posting.google.com>
2002-08-13 14:37 ` stupid question: how can I finish a program? chris.danx
2002-08-13 23:53   ` Robert C. Leif
2002-08-14  2:07     ` Wes Groleau
2002-08-14  5:53       ` Robert C. Leif
2002-08-14 13:30         ` Wes Groleau
2002-08-14 13:56       ` Marin D. Condic
2002-08-17 15:58         ` Robert Dewar
2002-08-14 19:18       ` Simon Wright
2002-08-15 14:02         ` Wes Groleau
2002-08-15  1:47       ` Robert Dewar
2002-08-15  5:14         ` Michael Bode
2002-08-17 14:28           ` Alfred Hilscher
2002-08-15  5:17         ` tmoran
2002-08-15 18:41           ` Robert Dewar
2002-08-14 13:53     ` Marin D. Condic
2002-08-15 17:39       ` tmoran
2002-08-16 13:46         ` Marin D. Condic
2002-08-17 14:26           ` Warren W. Gay VE3WWG [this message]
2002-08-22 19:16           ` tmoran
2002-08-22 20:54             ` Marin D. Condic
2002-08-25  2:22       ` Robert Dewar
2002-08-26 15:59         ` Marin D. Condic
2002-08-27 21:59         ` Robert A Duff
2002-08-28 20:40           ` Dmitry A.Kazakov
2002-08-28 13:59             ` Robert A Duff
2002-08-28 16:55               ` Darren New
2002-08-28 18:36                 ` Larry Kilgallen
2002-08-28 22:22                 ` Robert A Duff
2002-08-28 22:30                   ` Darren New
2002-08-28 23:16                     ` Robert A Duff
2002-08-29 16:49                       ` Warren W. Gay VE3WWG
2002-08-29 18:55                         ` Larry Kilgallen
2002-08-29 19:17                           ` Warren W. Gay VE3WWG
2002-08-30  8:09                         ` Ole-Hjalmar Kristensen
2002-08-31 20:39                           ` Warren W. Gay VE3WWG
2002-08-29 16:35                   ` Dennis Lee Bieber
2002-08-29 22:48               ` Dmitry A.Kazakov
2002-08-29 15:18                 ` Robert A Duff
2002-08-30  4:29                   ` Dmitry A.Kazakov
2002-08-29 16:53                     ` Warren W. Gay VE3WWG
2002-08-29 19:03                     ` Robert C. Leif
2002-08-29 19:25                       ` Warren W. Gay VE3WWG
2002-08-29 20:42                       ` Larry Kilgallen
2002-08-29 20:22                         ` Robert A Duff
2002-08-30 20:59                           ` Simon Wright
2002-08-28 14:33             ` Marin D. Condic
2002-08-28 22:15               ` Larry Kilgallen
2002-08-29 15:30                 ` Robert A Duff
2002-08-29 22:16               ` Dmitry A.Kazakov
2002-08-29 13:17                 ` Marin D. Condic
2002-08-29 19:32                   ` Robert A Duff
2002-08-31  2:40                   ` Dmitry A.Kazakov
2002-08-31  0:10                     ` Toshitaka Kumano
2002-09-02 21:02                       ` Dmitry A.Kazakov
2002-08-29 16:59                 ` Warren W. Gay VE3WWG
2002-08-29 18:26                   ` Marin D. Condic
2002-08-13 14:38 ` David C. Hoos
2002-08-13 20:08   ` Adam Beneschan
2002-08-14  6:41 ` Emil Moholth
2002-08-14 14:00   ` Marin D. Condic
2002-08-14  7:37 ` Martin Dowie
replies disabled

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