comp.lang.ada
 help / color / mirror / Atom feed
From: Duncan Woodward <doig@mwangi.demon.co.uk>
Subject: Ada-Trivial Problem
Date: 1997/02/28
Date: 1997-02-28T00:00:00+00:00	[thread overview]
Message-ID: <3317329D.167E@mwangi.demon.co.uk> (raw)


Im a first year comp sci student in glasgow scotland.
what i would like help on is a example prog that shows two procedures
running concurrently using tasking.
The procedures are sorts, however whilst they work they dont run
concurrently....why?


with list_operations; use
list_operations;                                        
procedure SORT(LIST: in ARRAY_OF_INTEGER) is
procedure Insertion_Sort (List : in out ARRAY_OF_INTEGER);  
procedure Selection_Sort (List : in out ARRAY_OF_INTEGER);

   task SORT1;    
   task SORT2;
         task body SORT1 is  
                        max:integer:=45;      
                        Data:array_of_integer(1..Max):=List;       
                  begin
                    INSERTION_SORT(Data);
                  end SORT1;
 
         task body SORT2 is  
                        max:integer:=45;      
                        Data:array_of_integer(1..Max):=List;       
                  begin
                    SELECTION_SORT(Data);
                  end SORT2;
                            ----------------------  

   procedure swap (left, right : in out INTEGER) is
     --statements--
     end swap;
                            -------------------

     procedure Insertion_Sort (List : in out ARRAY_OF_INTEGER) is
   -- statements--
     end Insertion_Sort;   
 
                           ----------------------

      procedure Selection_Sort (List : in out ARRAY_OF_INTEGER) is
        --statements--
      end Selection_Sort;    

                          -----------------------  
          

      begin

        
LIST_OPERATIONS.DISPLAY("drdw",23);                                          
       end SORT;
                
---------------------------




                 reply	other threads:[~1997-02-28  0:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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