sui icon indicating copy to clipboard operation
sui copied to clipboard

[core / node-sync] Get semaphore permit before launching task

Open gdanezis opened this issue 2 years ago • 1 comments

Previously we got items out of a (bounded) channel, launched a task, and then tried to get a semaphore permit. This means that in practice the channel was unbounded, and so were the number of tasks we could potentially launch. In this PR we take the semaphore ticket before we launch a task, in effect bounding the number of active tasks to execute digests, and allowing the channel to apply back pressure when execution is slow.

gdanezis avatar Jul 28 '22 14:07 gdanezis

i believe this is fine - I've promised you docs for a benchmarking process, so let me try to get that done so we can see what the effect of this is.

mystenmark avatar Jul 28 '22 17:07 mystenmark