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-19 07:13:19 PST From: "Ratson Janiv" Newsgroups: comp.lang.ada References: <3fe0d45e$1@news.barak.net.il> Subject: Re: A common array Date: Fri, 19 Dec 2003 17:10:57 +0200 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 82-166-194-25.barak.net.il X-Original-NNTP-Posting-Host: 82-166-194-25.barak.net.il Message-ID: <3fe31589$1@news.barak.net.il> X-Trace: news.barak.net.il 1071846793 82-166-194-25.barak.net.il (19 Dec 2003 17:13:13 +0300) X-Original-Trace: 19 Dec 2003 17:13:13 +0300, 82-166-194-25.barak.net.il Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!ash.uu.net!news.splitrock.net!nntp02.mcleodusa.net!dimaggio.newszilla.com!sinatra.newszilla.com!news.barak.net.il!not-for-mail Xref: archiver1.google.com comp.lang.ada:3555 Date: 2003-12-19T17:10:57+02:00 List-Id: Thanks. Well, U ask me to be more specific. I'll do that. I need to write a procedure that checks and prints the prime numbers between 1 and m. The procedure gets 2 parameter, m- the numbers to check 1..m and n - the number of tasks to perform it. each tak will check if a number is a prime number, and will update an array of booleans (size 1..m). At the end of all tasks the procedure prints the prime numbers. A managment task should manage all the tasks allocations ... Regards, Janiv Ratson. "Ratson Janiv" wrote in message news:3fe0d45e$1@news.barak.net.il... > 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. > >