comp.lang.ada
 help / color / mirror / Atom feed
From: jsa@alexandria (Jon S Anthony)
Subject: Re: How to wait for task completion
Date: 1996/09/18
Date: 1996-09-18T00:00:00+00:00	[thread overview]
Message-ID: <JSA.96Sep18191349@alexandria> (raw)
In-Reply-To: qw6k9tw3sci.fsf@gargantua.enst.fr


In article <01bba4c7$fa9f4650$2d208b82@wd> "wiljan" <W.Derks@nl.cis.philips.com> 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





  parent reply	other threads:[~1996-09-18  0:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-15  0:00 How to wait for task completion wiljan
1996-09-15  0:00 ` Samuel Tardieu
1996-09-16  0:00   ` wiljan
1996-09-17  0:00     ` Samuel Tardieu
1996-09-17  0:00       ` wiljan
1996-09-17  0:00       ` Norman H. Cohen
1996-09-17  0:00         ` wiljan
1996-09-18  0:00           ` Tucker Taft
1996-09-18  0:00             ` Norman H. Cohen
1996-09-17  0:00     ` Ted Dennison
1996-09-18  0:00   ` Jon S Anthony [this message]
1996-09-15  0:00 ` David C. Hoos, Sr.
1996-09-20  0:00   ` Stephen & Tammy House
1996-09-16  0:00 ` Jon S Anthony
replies disabled

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