comp.lang.ada
 help / color / mirror / Atom feed
From: "AG" <ang@xtra.co.nz>
Subject: Re: dynamic multithreading
Date: Sun, 17 Nov 2002 15:02:35 -0800
Date: 2002-11-17T15:02:35-08:00	[thread overview]
Message-ID: <8MCB9.8643$8o1.1371873@news.xtra.co.nz> (raw)
In-Reply-To: 3DD3D841.CD16A4CB@canal-plus.fr

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


"Thierry Lelegard" <thierry.lelegard@canal-plus.fr> wrote in message
news:3DD3D841.CD16A4CB@canal-plus.fr...
> Bj�rn Lundin wrote:
> > If I remember correctly, there's an example of
> > a process action as server, listening for new connections.
> > For each new connection, a new task is created
>
> This is generally a bad design.

That's arguable.

>
> - First, there is performance issue. Creating a new task each time
>   a new connection comes in is a pain on heavily loaded servers.

Well, servers come and go, tech impoves or not but design stays.

>
> - 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? 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.

>
> 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. 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. (Hey, how many
projects agonized like that for years instead of just restarting
at a good time?) That does not include the safety-critical systems,
of course, just the common "run of the mill" things.

> 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. There is also a lot less potential
for errors since you don't need to keep or handle previous
states. So how can it be less robust? (Unless, as stated above,
you simply don't trust your run-time system to even de-allocate
the stack)





  parent reply	other threads:[~2002-11-17 23:02 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 [this message]
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
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