Re: Parallel Sieve Of Eratosthenes

Liste des GroupesRevenir à cl ada 
Sujet : Re: Parallel Sieve Of Eratosthenes
De : rosen (at) *nospam* adalog.fr (J-P. Rosen)
Groupes : comp.lang.ada
Date : 30. Jun 2024, 17:36:45
Autres entêtes
Organisation : Adalog
Message-ID : <v5s1it$jldp$1@dont-email.me>
References : 1 2
User-Agent : Mozilla Thunderbird
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

Date Sujet#  Auteur
30 Jun 24 * Parallel Sieve Of Eratosthenes6Lawrence D'Oliveiro
30 Jun 24 `* Re: Parallel Sieve Of Eratosthenes5Lawrence D'Oliveiro
30 Jun 24  `* Re: Parallel Sieve Of Eratosthenes4J-P. Rosen
1 Jul 24   `* Re: Parallel Sieve Of Eratosthenes3Lawrence D'Oliveiro
1 Jul 24    `* Re: Parallel Sieve Of Eratosthenes2J-P. Rosen
1 Jul 24     `- Re: Parallel Sieve Of Eratosthenes1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal