Lectures Ada_3

Lectures Ada_3 - The Tasking Facility In Ada It is used to...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
The Tasking Facility In Ada It is used to allow concurrent tasking, where tasks can be of non- communicating and communicating natures: A) Non-communicating Tasks: procedure P is task T 1 ; … (SPECS interface of task T 1 )… ; end T 1 ; task body T 1 is begin … end T 1 ; *** task T n ; … (SPECS interface of task T n )… ; end T n ; task body T n is begin … end T n ; begin -- code for P (It is very important to notice such Ada's tasking features unique in the domain of Ada's like HLLs) tasks T 1 … T n will start once we enter the code of P without any explicit call statement for each. P will not terminate until all of its tasks terminate, last terminating task could any of the n tasks! e nd P; Tasks can not be a lib unit , they must be declared within some program unit. Ada will prevent any subprogram that hosts any task(s) from terminating until all of its hosted tasks terminate . The reason is related to the disappearance (upon return/termination) of an environment (that of the hosting subprogram) that is needed by the task(s), otherwise they become orphan tasks .
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
B) Communicating Tasks Communicate and Synchronize via Rendezvous ”: Two tasks ( client and server ) will rendezvous via an “ entry (procedure like construct ) which is to be declared in the server and “called” by the client upon requesting some service (from such server). The client “ call ” on some server “ entry ” must be “accepted ” by the server, pending on the server availability, before any service is granted . At the client:
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/23/2011 for the course CSE 324 taught by Professor Soliman during the Spring '11 term at NMT.

Page1 / 7

Lectures Ada_3 - The Tasking Facility In Ada It is used to...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online