comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen@adalog.fr>
Subject: Re: Server - tasking and long lived connections
Date: Tue, 18 Dec 2001 10:08:09 +0100
Date: 2001-12-18T10:08:09+01:00	[thread overview]
Message-ID: <9vn12l$hv2$1@s1.read.news.oleane.net> (raw)
In-Reply-To: 3C1DC5ED.9E9F11F1@canal-plus.fr

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


"Thierry Lelegard" <thierry.lelegard@canal-plus.fr> a �crit dans le message news: 3C1DC5ED.9E9F11F1@canal-plus.fr...
> Jean-Pierre Rosen wrote :
> >
> > "Thierry Lelegard" <thierry.lelegard@canal-plus.fr> a �crit dans le message news: 3C1DB7B7.DF767F9@canal-plus.fr...
> > > I think that the trap in this kind of applications (servers with one
> > > or more tasks per client connection) is the fate of the tasks when
> > > the client disconnects. If you let the tasks die and recreate new
> > > tasks for new client connections, you will most certainly face some
> > > slow memory leak. We have seen that, although the stack itself is
> > > deallocated when a task dies, there aer a few bytes which remain
> > > allocated (some kind of TCB I suppose).
> > >
> > This was due to the (in)famous Rosen's pathology ;-)
> > It has been (fortunately) exterminated in in Ada 95, so the problem should not appear any more.
>
> Quite interesting. Could you elaborate on this? What kind of change was
> introduced in Ada95 to eliminate this?
>
Here is (was) the problem:

task type TT is....

function F return TT is
   Local : tt;
begin
   return Local;
end F;

....

if F'Terminated then..... -- Allways true

The master of Local is function F; but since it is returned by the function, it is still possible to access the task object after
the scope of its master has been left (although the task will allways be terminated); hence the need to keep a minimum information,
and since the master is left, there is no logical place where that information can be reclaimed.

In Ada 95, a task type is a by-reference type (6.2(6)), and a function is not allowed to return a local object of a by-reference
type (6.5(18)). Therefore, the above program will raise Program_Error (6.5(20)).

--
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr





  reply	other threads:[~2001-12-18  9:08 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-13  3:23 List Container Strawman 1.4 Ted Dennison
2001-12-13 18:11 ` Brian Hanson
2001-12-13 23:02 ` Nick Roberts
2001-12-14 15:19   ` Ted Dennison
2001-12-14 23:54     ` Ted Dennison
2001-12-15  2:06       ` Server - tasking and long lived connections Eric Merritt
2001-12-15  3:10         ` James Rogers
2001-12-15 12:10           ` Florian Weimer
2001-12-15 14:38         ` Larry Kilgallen
2001-12-15 16:51         ` Steve Doiel
2001-12-17  9:15         ` Thierry Lelegard
2001-12-17  9:34           ` Jean-Pierre Rosen
2001-12-17 10:16             ` Thierry Lelegard
2001-12-18  9:08               ` Jean-Pierre Rosen [this message]
2001-12-17 15:08             ` Larry Kilgallen
2001-12-17 15:39               ` Pat Rogers
2001-12-19 18:20         ` Matthew Heaney
2001-12-19 18:50           ` Eric Merritt
2001-12-15  1:20     ` List Container Strawman 1.4 Nick Roberts
2001-12-15 20:29       ` Ted Dennison
2001-12-16 18:45         ` Nick Roberts
2001-12-21 15:53           ` Ted Dennison
2001-12-21 16:42             ` Marin David Condic
2001-12-21 18:28               ` Ted Dennison
2001-12-21 18:47                 ` Marin David Condic
2001-12-21 19:39                   ` Ted Dennison
2001-12-21 19:48                     ` Marin David Condic
2001-12-22 12:29                     ` Simon Wright
2001-12-21 20:03                   ` Nick Roberts
2001-12-21 16:52             ` Marin David Condic
2001-12-21 18:41               ` Ted Dennison
2001-12-21 19:14                 ` Marin David Condic
2001-12-21 21:13                   ` Ted Dennison
2001-12-22  5:34                     ` John B. Matthews
2001-12-21 20:19                 ` Stephen Leake
2001-12-21 21:35                   ` Ted Dennison
2001-12-24 11:58               ` Florian Weimer
2001-12-24 14:42                 ` Eric Merritt
2001-12-24 22:47                 ` Ted Dennison
2001-12-25 22:15                   ` Florian Weimer
2001-12-28 13:58                     ` Ted Dennison
2001-12-21 17:43             ` Stephen Leake
2001-12-21 18:44               ` Ted Dennison
2001-12-16 21:53         ` Larry Hazel
2001-12-15 22:27           ` Ted Dennison
2001-12-16  4:32             ` Darren New
2001-12-24 13:53               ` Florian Weimer
2001-12-15 23:19 ` Florian Weimer
2001-12-16  4:46   ` Ted Dennison
2001-12-24 13:57     ` Florian Weimer
2001-12-28 14:00       ` Ted Dennison
2001-12-28 16:43         ` Hyman Rosen
2001-12-28 19:12           ` Nick Roberts
2001-12-28 19:49           ` Matthew Heaney
2001-12-29 23:23             ` Matthew Heaney
2001-12-30  6:31               ` Hyman Rosen
2002-01-03  0:09                 ` Matthew Heaney
2002-01-03  0:20                   ` Brian Rogoff
2001-12-17  8:34   ` Mark Lundquist
2001-12-18 21:56     ` Florian Weimer
2001-12-18 21:54       ` Larry Kilgallen
2001-12-18 22:34       ` Mark Lundquist
2001-12-19  4:03         ` Nick Roberts
2001-12-24 13:54           ` Florian Weimer
     [not found] <3C1ABF3F.8CDCC8F9@worldnet.att.net>
2001-12-15  4:42 ` Server - tasking and long lived connections Eric Merritt
2001-12-15 12:18   ` Florian Weimer
2001-12-15 17:56     ` Eric Merritt
     [not found] <20011215175619.80358.qmail@web13002.mail.yahoo.com>
2001-12-17  3:43 ` Steven Deller
     [not found] <000001c186ac$fb7b4020$1337e5c0@STEVEN>
2001-12-17  5:17 ` Eric Merritt
replies disabled

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