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,e2e6547249e6f9d1 X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: How to wait for task completion Date: 1996/09/17 Message-ID: <323EBE42.3F54BC7E@escmail.orl.mmc.com>#1/1 X-Deja-AN: 181168166 references: <01bba2e8$c45aad90$35208b82@wd> <01bba3f7$ee398fe0$10208b82@wd> content-type: text/plain; charset=us-ascii organization: Lockheed Martin Information Systems mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (X11; I; SunOS 4.1.3_U1 sun4m) Date: 1996-09-17T00:00:00+00:00 List-Id: wiljan wrote: > > In my case I want to wait for task completion, Not until it is almost > completed. The code that has to wait for the task completion want to > clean up resources when that task is terminated. If these resources > are cleaned up before that, it will certainlly lead to erroneous execution. > In my case I want to clean up the task object itself by using > ada.unchecked_deallocation. What I have seen done is creation of a stack of tasks that are currently unused. In this particular case each task put ITSELF on the stack when it was done. Any time a new task was needed, it got pulled off the stack and re-activated, or created with dynamic allocation if the stack was empty. This setup could easily be modified to do periodic garbage collection (checking the 'terminated attribute, just to be safe). -- T.E.D. | Work - mailto:dennison@escmail.orl.mmc.com | | Home - mailto:dennison@iag.net | | URL - http://www.iag.net/~dennison |