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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable 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-17 18:26:39 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!green.octanews.net!news.octanews.net!news-out.visi.com!petbe.visi.com!skynet.be!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: A common array Date: 17 Dec 2003 21:25:28 -0500 Organization: Cuivre, Argent, Or Message-ID: References: <3fe0d45e$1@news.barak.net.il> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1071714340 67020 80.67.180.195 (18 Dec 2003 02:25:40 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Thu, 18 Dec 2003 02:25:40 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: <3fe0d45e$1@news.barak.net.il> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.3 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:3524 Date: 2003-12-17T21:25:28-05:00 "Ratson Janiv" writes: > I need to write a program that creates a random number of tasks. Hmm. It usually helps if you tell us what you are _really_ trying to do; often Ada has a totally different approach than you are used to. > 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. > 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. You'll need a loop in the tasks; at the top, they wait on a rendezvous to get the number to check. Then do the check, then loop back. You have to make sure all the tasks can terminate nicely; sometimes that requires a Quit rendezvous. > 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. Hope this helps. -- -- Stephe