From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: How to make tasks to run in parallel
Date: Tue, 17 Oct 2017 09:29:00 +0200
Date: 2017-10-17T09:29:00+02:00 [thread overview]
Message-ID: <os4bfs$taa$1@gioia.aioe.org> (raw)
In-Reply-To: d60e5e8f-e06a-410c-bcce-bb8fba358d52@googlegroups.com
On 17/10/2017 06:58, reinert wrote:
> I would prefer to enter data via entry/accept. But is it possible
> without giving up parallel processing? I feel it is something I should
> understand better here :-)
select
accept run1(a : in real) do
x := a; -- Store parameter and let the caller go
end run1;
for I in 1 .. N loop -- Do the work concurrently
x := x + Real(I)/Real(N);
x := 0.5*x + 1.0 + sin(x)*cos(x) + sin(x) + cos(x) +
sin(x)*sin(x) + cos(x)*cos(x);
end loop;
new_line;Put("test2 x:");Put (x,4,16,0); New_Line (1);
or terminate; -- Exit if the parent does
end select;
First, as others mentioned, you should not do concurrent work in the
rendezvous. Second, add "terminate" to let the task exit even if "run1"
was never called.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2017-10-17 7:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-17 4:58 How to make tasks to run in parallel reinert
2017-10-17 6:08 ` gautier_niouzes
2017-10-17 7:25 ` reinert
2017-10-17 15:36 ` Jeffrey R. Carter
2017-10-21 12:32 ` Jacob Sparre Andersen
2017-10-17 6:17 ` Per Sandberg
2017-10-17 6:30 ` gautier_niouzes
2017-10-17 7:32 ` reinert
2017-10-17 7:47 ` Dmitry A. Kazakov
2017-10-17 8:06 ` Niklas Holsti
2017-10-17 8:48 ` Dmitry A. Kazakov
2017-10-17 11:13 ` Simon Wright
2017-10-17 12:11 ` Dmitry A. Kazakov
2017-10-17 14:23 ` AdaMagica
2017-10-17 9:06 ` reinert
2017-10-17 10:04 ` Dmitry A. Kazakov
2017-10-17 7:29 ` Dmitry A. Kazakov [this message]
2017-10-17 7:36 ` reinert
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox