comp.lang.ada
 help / color / mirror / Atom feed
From: "Jonas Nygren" <ehsjony@ehs.ericsson.se>
Subject: Task deallocation
Date: 1997/02/11
Date: 1997-02-11T00:00:00+00:00	[thread overview]
Message-ID: <01bc185c$76beb9c0$829d6482@joy.ericsson.se> (raw)


I have a problem related to freeing tasks, that I can't find a good
solution to. Here follows a short description of my problem.

I am doing a server-task that dynamically allocates sub-tasks to handle
individual requests. I want the sub-tasks to use a terminate alternative
so that they terminate when the server-task is terminated. My problem is
how to reclaim the storage for the sub-tasks. One possible alternative is
to have a linked list of the sub-tasks outside of the-server task and then
scan this list of sub-tasks for terminated tasks and delete them,
recursively
until the list is empty. This code looks a bit on the heavy side and maybe
there is an easier way to reclaim the storage used by these tasks.

Anybody have any good suggestions of a better alternative to the solution I
described above? Any suggestions are welcome.

/jonas

PS If the sub-task type were defined inside the server-task then it should
   be possible for the Ada RT to automagically free the sub-tasks after the
   the termination of the server-task since they cannot be referenced by 
   any other entity. I have read the Ada RM but I cannot find anything on 
   this topic (except that it is an error to free a non-terminated task). DS




             reply	other threads:[~1997-02-11  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-11  0:00 Jonas Nygren [this message]
1997-02-12  0:00 ` Task deallocation Mats Weber
  -- strict thread matches above, loose matches on Subject: below --
1997-02-23  0:00 Jonas Nygren
1997-02-28  0:00 ` Mats Weber
1997-03-01  0:00   ` Robert Dewar
1997-03-03  0:00     ` Mats Weber
1997-03-04  0:00       ` Robert Dewar
replies disabled

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