sui
sui copied to clipboard
[core / node-sync] Get semaphore permit before launching task
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.
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.