comp.lang.ada
 help / color / mirror / Atom feed
* Dynamic task activation
@ 2005-05-09 11:02 evangeli
  2005-05-09 12:24 ` Jean-Pierre Rosen
  0 siblings, 1 reply; 3+ messages in thread
From: evangeli @ 2005-05-09 11:02 UTC (permalink / raw)


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.

Thanks




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Dynamic task activation
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Jean-Pierre Rosen @ 2005-05-09 12:24 UTC (permalink / raw)


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.

-- 
---------------------------------------------------------
            J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Dynamic task activation
  2005-05-09 12:24 ` Jean-Pierre Rosen
@ 2005-05-09 14:29   ` Marc A. Criley
  0 siblings, 0 replies; 3+ messages in thread
From: Marc A. Criley @ 2005-05-09 14:29 UTC (permalink / raw)


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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-05-09 14:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox