comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: dynamic multithreading
Date: 18 Nov 2002 09:30:30 -0500
Date: 2002-11-18T14:42:04+00:00	[thread overview]
Message-ID: <uzns7t0ft.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 8MCB9.8643$8o1.1371873@news.xtra.co.nz

"AG" <ang@xtra.co.nz> writes:

> "Thierry Lelegard" <thierry.lelegard@canal-plus.fr> wrote in message
> news:3DD3D841.CD16A4CB@canal-plus.fr...
> > - Second, you must absolutely unchecked_deallocate each task after
> >   it is terminated (not always trivial to synchronize on actual
> >   termination of a task). Otherwise, you have a memory leak.
> 
> Which means you don't trust the run-time system to do some
> elementary GC? 

Well, since the Ada Standard says that anything allocated with "new"
will _not_ be "garbage collected", I do _not_ expect the "run-time
system" to do "free" for me.

Nothing wrong with doing "free" myself. If, as Thierry hinted, it is
not easy to determine when the "free" is safe, then why would it be
any easier for some run-time system to determine this?

> If you are *that* paranoid (or have a good reason to be) perhaps
> it's time to abandon Ada and switch back to the good old Assembly
> language.

Name one Assembly language that has garbage collection! 

Paranoia has nothing to do with it; this is about reading the standard
and understanding what it says.

> > As an alternative, never let a service task die. Once a task has
> > finished servicing a connection, make it wait and reuse it for a
> > later connection.
> 
> Yuck. That means the task needs to be able to reset to a clean
> state anytime it's finished with a connection. 

Yes. Why is that hard? If the state is not "clean", then there are
loose ends that should be cleaned up. Why is it ok to "just kill"
something with loose ends? That's a sloppy design.

> It would also need to handle all possible error conditions and
> abnormal ends to be able to come back on line "up and ready". It's
> much much cleaner to just let the task die and start from scratch.

Apparently you believe the operation of "let the task die" will clean
up all the loose ends and restore a clean state. Can you quote the Ada
Standard to justify that?

How, exactly, do you "let the task die"?

> (Hey, how many projects agonized like that for years instead of just
> restarting at a good time?)

Interesting analogy.

> That does not include the safety-critical systems, of course, just
> the common "run of the mill" things.

If it makes money for me, it is _not_ "run of the mill" :).

> > This is not so difficult to design and much more robust.
> 
> I'd disagree. It is much easier to design a system which
> always starts from scratch. 

That's arguable :).

> There is also a lot less potential for errors since you don't need
> to keep or handle previous states. 

You are assuming the operating system does it for you. Not a safe
assumption. 

> So how can it be less robust? 

Knowing precisely what is going on is always more robust than hoping
some undocumented feature will save you.

> (Unless, as stated above, you simply don't trust your run-time
> system to even de-allocate the stack)

I don't trust the run-time system to do something it explicitly says
it will _not_ do!

-- 
-- Stephe



  parent reply	other threads:[~2002-11-18 14:30 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-14 13:12 dynamic multithreading Artiom Ivanov
2002-11-14 13:49 ` David Marceau
2002-11-14 14:14 ` Björn Lundin
2002-11-14 17:07   ` Thierry Lelegard
2002-11-14 18:59     ` tmoran
2002-11-14 22:04       ` Robert A Duff
2002-11-15  9:27       ` Jean-Pierre Rosen
2002-11-17 23:02     ` AG
2002-11-17  5:17       ` tmoran
2002-11-17 12:40       ` Simon Wright
2002-11-18  9:11       ` Thierry Lelegard
2002-11-18 12:12         ` Dmitry A. Kazakov
2002-11-18 16:18           ` Pascal Obry
2002-11-18 16:25             ` Lutz Donnerhacke
2002-11-18 16:21               ` Simon Wright
2002-11-19  9:03                 ` Lutz Donnerhacke
2002-11-19 21:41                   ` Simon Wright
2002-11-18 16:28               ` Preben Randhol
2002-11-18 16:30                 ` Lutz Donnerhacke
2002-11-18 16:35                   ` Preben Randhol
2002-11-18 16:44                     ` Lutz Donnerhacke
2002-11-18 18:58                       ` Preben Randhol
2002-11-19  9:09                         ` Lutz Donnerhacke
2002-11-18 19:00                       ` Preben Randhol
2002-11-19  9:11                         ` Lutz Donnerhacke
2002-11-19  9:32                           ` Preben Randhol
2002-11-19 11:18                             ` Lutz Donnerhacke
2002-11-19 12:42                       ` Georg Bauhaus
2002-11-19  9:00             ` Dmitry A. Kazakov
2002-11-18 14:30       ` Stephen Leake [this message]
2002-11-18 17:41         ` David C. Hoos
2002-11-14 14:29 ` David C. Hoos
2002-11-14 18:37 ` Jeffrey Carter
2002-11-14 22:03 ` Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
2002-11-18  9:22 Grein, Christoph
2002-11-18 12:25 ` Thierry Lelegard
2002-11-18 13:32   ` Dmitry A. Kazakov
2002-11-18 16:20     ` Pascal Obry
2002-11-18 12:13 Grein, Christoph
2002-11-18 13:38 ` Dmitry A. Kazakov
2002-11-19  5:28 Grein, Christoph
2002-11-19  6:38 Grein, Christoph
2002-11-19  9:13 ` Lutz Donnerhacke
2002-11-19  6:46 Grein, Christoph
2002-11-19  6:49 Grein, Christoph
2002-11-20 18:20 ` Matthew Heaney
2002-11-27 15:55 ` John English
replies disabled

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