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: jsa@alexandria (Jon S Anthony) Subject: Re: How to wait for task completion Date: 1996/09/18 Message-ID: #1/1 X-Deja-AN: 181477651 sender: news@organon.com (news) references: <01bba2e8$c45aad90$35208b82@wd> organization: Organon Motives, Inc. newsgroups: comp.lang.ada Date: 1996-09-18T00:00:00+00:00 List-Id: In article <01bba4c7$fa9f4650$2d208b82@wd> "wiljan" writes: > So my question is how to make this program work: > task type xtask; > task body xtask is > begin > null; > end xtask; > type pxtask is access xtask; > > for i in integer'range loop > declare p:pxtask:=new xtask; > end loop; > The program can be made working when doing a lot of adminstrating > on the pointers to the objects created in the main program. > I actually want to deallalocate them in the task itself when they complete. OK, I don't get it. There is something about this that is not yet sufficiently described with respect to what it is you want to achieve. The above sort of program can be "made to work" by: for I in Integer'Range loop declare P : Xtask; begin null; end; end loop; or for I in Integer'Range loop declare type Pxtask is access Xtask; P : Pxtask := new Xtask; begin null; end; -- Storage associated with Pxtask is freed. end loop; Since you are not keeping the tasks around after the loop, either of these will work (though it is hard to see any reason for choosing the second version). But, I have the feeling this doesn't really address what you are after. So, just what is it you really want? /Jon -- Jon Anthony Organon Motives, Inc. 1 Williston Road, Suite 4 Belmont, MA 02178 617.484.3383 jsa@organon.com