From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: Parallel Sieve Of Eratosthenes
Date: Sun, 30 Jun 2024 18:36:45 +0200 [thread overview]
Message-ID: <v5s1it$jldp$1@dont-email.me> (raw)
In-Reply-To: <v5r3su$e60t$2@dont-email.me>
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
next prev parent reply other threads:[~2024-06-30 16:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-30 8:06 Parallel Sieve Of Eratosthenes Lawrence D'Oliveiro
2024-06-30 8:10 ` Lawrence D'Oliveiro
2024-06-30 16:36 ` J-P. Rosen [this message]
2024-07-01 0:02 ` Lawrence D'Oliveiro
2024-07-01 9:17 ` J-P. Rosen
2024-07-01 21:48 ` Lawrence D'Oliveiro
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox