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,FREEMAIL_FROM, T_HK_NAME_FM_MR_MRS 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:13 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: ratsonjaniv@hotmail.com (Mr. J.) Newsgroups: comp.lang.ada Subject: Re: A common array Date: 19 Dec 2003 07:13:12 -0800 Organization: http://groups.google.com Message-ID: References: <3fe0d45e$1@news.barak.net.il> NNTP-Posting-Host: 82.166.194.25 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1071846793 28592 127.0.0.1 (19 Dec 2003 15:13:13 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 19 Dec 2003 15:13:13 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:3554 Date: 2003-12-19T07:13:12-08: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. Wes Groleau wrote in message news:... > Stephen Leake wrote: > >>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 ? > > > > Put that common array in yet another task, or in a protected object. > > Or, make each 'cell' a protected object. But, since each > cell has it's own task updating it, maybe the protection > is not needed? (As Stephen said, you haven't given enough > information.)