From mboxrd@z Thu Jan 1 00:00:00 1970 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Parallel Sieve Of Eratosthenes Date: Sun, 30 Jun 2024 18:36:45 +0200 Organization: Adalog Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 30 Jun 2024 18:36:45 +0200 (CEST) Injection-Info: dont-email.me; posting-host="8234771efee73dc9504b9c7a93e90712"; logging-data="644537"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Rc9pvf7vbq8SynECt2QbV" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:Uu10CG/e6HS4MgQP91kbuydjiXc= In-Reply-To: Content-Language: en-US, fr Xref: news.eternal-september.org comp.lang.ada:66209 List-Id: Le 30/06/2024 à 10:10, Lawrence D'Oliveiro a écrit : > This version uses a protected type to pass the stream of integers from > one task to the next. It seems to be much faster. That's because in your first version, you call the child within the accept statement. Therefore you wait for the value to go to the end of the pipeline before processing the next value. Try to copy the number to a variable, and call the child after the end of the accept. This will give you 100% CPU time usage. BTW, you don't need an access type. Just use a declare block to create the child after the first accept. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX https://www.adalog.fr https://www.adacontrol.fr