"Thierry Lelegard" a �crit dans le message news: 3C1DC5ED.9E9F11F1@canal-plus.fr... > Jean-Pierre Rosen wrote : > > > > "Thierry Lelegard" 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