comp.lang.ada
 help / color / mirror / Atom feed
From: "Marc A. Criley" <mcNOSPAM@mckae.com>
Subject: Re: Dynamic task activation
Date: Mon, 09 May 2005 09:29:39 -0500
Date: 2005-05-09T09:29:39-05:00	[thread overview]
Message-ID: <200f5$427f73d3$4995042$12412@ALLTEL.NET> (raw)
In-Reply-To: <iqkn5d.mfh.ln@hunter.axlog.fr>

Jean-Pierre Rosen wrote:
> evangeli@cnam.fr a �crit :
> 
>> hello
>> let's take this piece of code :
>>
>> ====================================
>> ...
>> task type T_Task;
>> type T is access T_Task;
>> ...
>> V : T := new T_Task;
>> --  1
>> ...
>> ====================================
>>
>> Is the task pointed by V necessarily activated at point 1, or can it be
>> activated later?
>>
>>> From RM 9.2.4, I guess the answer is yes but i wanted to be sure.
>>
>>
> The task is activated *before* the return from "new". The goal is that 
> when you can access the task, it is guaranteed to have been activated.

And if for some reason you don't want the task to actually begin its 
application-specific processing until later, you can declare some kind 
of "Start" entry in the task, which is then called at the appropriate time.

task body T_Task_That_Waits is
begin
    select
       accept Start;
    or
       terminate;
    end select;

    -- Application-oriented processing now begins...

end T_Task_That_Waits;


Marc A. Criley
www.mckae.com




      reply	other threads:[~2005-05-09 14:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-09 11:02 Dynamic task activation evangeli
2005-05-09 12:24 ` Jean-Pierre Rosen
2005-05-09 14:29   ` Marc A. Criley [this message]
replies disabled

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