From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6f1d6da490488dc7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-20 10:56:33 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!elnk-pas-nf1!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread3.news.atl.earthlink.net.POSTED!42e449c4!not-for-mail From: "@Fill(NOSPAM)YourBrain.com" <""chris\"@Fill(NOSPAM)YourBrain.com"> User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: A common array References: <3fe0d45e$1@news.barak.net.il> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Sat, 20 Dec 2003 18:56:32 GMT NNTP-Posting-Host: 24.233.134.238 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.atl.earthlink.net 1071946592 24.233.134.238 (Sat, 20 Dec 2003 10:56:32 PST) NNTP-Posting-Date: Sat, 20 Dec 2003 10:56:32 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:3636 Date: 2003-12-20T18:56:32+00:00 List-Id: Ratson Janiv wrote: > Hi, > I need to write a program that creates a random number of tasks. > I need the tasks to update a common array (1 array for all the tasks). > do I need keep the array updating in critical section (I know that each task > will update a differnet cell in the array), if so how ? > Also I need to write a mechanism that enables the task to perform the check > twice with two differnet parameters, e.g. I call Task X to check Numer 4 in > the array, and after it finishes, I want it to notify me, and also I want > teh task X to check the 18 Number. > > for the decency, I M studying Ada, and it is part of my work, so please try > to help me as much as U can without writing the answers to me, I think some > guide lines will be helpful. > > Many Many thanks, > Janiv Ratson. > > Hi, I'm new at this too. But I just got through "Ada as a Second Language" and I believe your answer is to just make the array of tasks a protected type. Procedures for protected types are critical sections for the type.