From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: *** X-Spam-Status: No, score=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8d9c008219fb2dce,start X-Google-Attributes: gid103376,public From: "Jonas Nygren" Subject: Task deallocation Date: 1997/02/11 Message-ID: <01bc185c$76beb9c0$829d6482@joy.ericsson.se>#1/1 X-Deja-AN: 218091987 organization: Ericsson newsgroups: comp.lang.ada Date: 1997-02-11T00:00:00+00:00 List-Id: 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