comp.lang.ada
 help / color / mirror / Atom feed
* Question on tasking...
@ 1993-08-10 14:46 John Halper
  0 siblings, 0 replies; 4+ messages in thread
From: John Halper @ 1993-08-10 14:46 UTC (permalink / raw)


I have a question in the following program,

procedure Main is
        task type Task_Type;
        type Task_Ptr is access Task_Type;
        Task_Instance : Task_Type;
begin
   block:
      begin
         Task_Instance := new Task_Type;
         Task_Instance := null;
      end;  -->  Does block wait until Task_Instance Terminates ????
end Main;

-- 

John Halper
jjh@evb.com

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

* Re: Question on tasking...
@ 1993-08-10 17:56 vnet.IBM.COM
  0 siblings, 0 replies; 4+ messages in thread
From: vnet.IBM.COM @ 1993-08-10 17:56 UTC (permalink / raw)


In article:  8457    jjh@evb.com writes:

>I have a question in the following program,
>
>procedure Main is
>        task type Task_Type;
>        type Task_Ptr is access Task_Type;
>        Task_Instance : Task_Type;
>begin
>   block:
>      begin
>         Task_Instance := new Task_Type;
>         Task_Instance := null;
>      end;  -->  Does block wait until Task_Instance Terminates ????
>end Main;

John,
The block will not wait for the task to terminate as the access type to
the task is in Main.  LRM 9.4 1(a) mentions this.  To get the block to
wait, move the access type and variable declarations into a declare block.

*****************************************
* Phil Dennis      pdennis@vnet.ibm.com *
* McDonnell Douglas ESC  subbing to IBM *
*                                       *
* Of course these opinions are mine, I  *
* can barely speak for myself, let alone*
* McDonnell Douglas or IBM!             *
******************************************

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

* Re: Question on tasking...
@ 1993-08-10 23:00 Robert I. Eachus
  0 siblings, 0 replies; 4+ messages in thread
From: Robert I. Eachus @ 1993-08-10 23:00 UTC (permalink / raw)


In article <1993Aug10.144611.23993@evb.com> jjh@evb.com (John Halper) writes:

   > I have a question in the following program,
   >    procedure Main is
   >	   task type Task_Type;
   >	   type Task_Ptr is access Task_Type;
   > 	   Task_Instance : Task_Type;
   > begin
   >    block:
   > 	 begin
   > 	    Task_Instance := new Task_Type;
   > 	    Task_Instance := null;
   > 	 end;  -->  Does block wait until Task_Instance Terminates ????
   > end Main;

     No, Main does.

     And now for the language lawyering...actually Main will not be
left until the task instance created in the block* is completed or
waiting at a terminate alternative.  For tasks created by allocators,
the master is the block containing the access type declaration, or in
the case of library packages, the master is the environment task,
which allows the main program to exit before all library tasks have
completed.  (See RM 9.4, especially paragraph 2 and the note in
paragraph 13.)

* And any dependant tasks, you didn't show us the task body...

--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...

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

* Re: Question on tasking...
@ 1993-08-18 23:38 cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!howland.
  0 siblings, 0 replies; 4+ messages in thread
From: cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!howland. @ 1993-08-18 23:38 UTC (permalink / raw)


In article <1993Aug10.144611.23993@evb.com>, jjh@evb.com (John Halper) writes:
|> I have a question in the following program,
|> 
|> procedure Main is
|>         task type Task_Type;
|>         type Task_Ptr is access Task_Type;
|>         Task_Instance : Task_Type;
|> begin
|>    block:
|>       begin
|>          Task_Instance := new Task_Type;
|>          Task_Instance := null;
|>       end;  -->  Does block wait until Task_Instance Terminates ????

No, it does not. The master of all tasks pointed to by the type Task_Ptr
is the procedure Main. (See LRM 9.4(2)).

|> end Main;
|> 
|> -- 
|> 
|> John Halper
|> jjh@evb.com

-- 
Mats Weber
e-mail: weber@lglsun.epfl.ch

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

end of thread, other threads:[~1993-08-18 23:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-08-10 23:00 Question on tasking Robert I. Eachus
  -- strict thread matches above, loose matches on Subject: below --
1993-08-18 23:38 cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!howland.
1993-08-10 17:56 vnet.IBM.COM
1993-08-10 14:46 John Halper

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