Deutsch   English   Français   Italiano  
<v5s1it$jldp$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: "J-P. Rosen" <rosen@adalog.fr>
Newsgroups: comp.lang.ada
Subject: Re: Parallel Sieve Of Eratosthenes
Date: Sun, 30 Jun 2024 18:36:45 +0200
Organization: Adalog
Lines: 17
Message-ID: <v5s1it$jldp$1@dont-email.me>
References: <v5r3ma$e60t$1@dont-email.me> <v5r3su$e60t$2@dont-email.me>
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: <v5r3su$e60t$2@dont-email.me>
Content-Language: en-US, fr
Bytes: 1765

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