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: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 379 |
Nodes: | 16 (2 / 14) |
Uptime: | 44:46:51 |
Calls: | 8,141 |
Calls today: | 4 |
Files: | 13,085 |
Messages: | 5,858,055 |