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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,622a39829f542d91,start X-Google-Attributes: gid103376,public From: Alfred Hilscher Subject: deallocation tasks Date: 2000/05/03 Message-ID: <39102BF9.584EB022@icn.siemens.de>#1/1 X-Deja-AN: 618685208 Content-Transfer-Encoding: 7bit Organization: Siemens AG X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-05-03T00:00:00+00:00 List-Id: Hi, does anyone have a proposal for the following problem ? What I want do is this: I have a loop that reads input and processes it. If the input is something that would require long runtime, I want create a new task so that it can run in background. But if the task terminates I think I should free the (heap) memory. My code would look someting like this: task type t is ... type a_t is access t; n_t : a_t; ... loop -- get input if -- input requires less time then -- consume it else -- input requires much time, start background task n_t := new a_t(input); -- memory allocated here should be deallocated after task termination end if; end loop; Any suggestions how to 'DEALLOCATE' the memory ? There can be more than one task at a time. Any other ideas ?