This version uses a protected type to pass the stream of integers fromThat's because in your first version, you call the child within the
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.
On Sun, 30 Jun 2024 18:36:45 +0200, J-P. Rosen wrote:
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.
Thanks for the comments, how about this slight rework of the first
version. It does seem faster, but I’m not sure it’s as fast as the second version.
That's better, but as a general principle, you should move as much as
you can out of the rendezvous (minimize critical sequences).
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 991 |
Nodes: | 10 (0 / 10) |
Uptime: | 81:44:47 |
Calls: | 12,949 |
Calls today: | 3 |
Files: | 186,574 |
Messages: | 3,264,673 |