feat: fine-grained scheduling priority #462
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces finer-grained scheduling priorities for the Yazi task system, supplementing and enhancing the existing micro and macro tasks.
Previously, Yazi categorized tasks requiring quick responsiveness as micro tasks; and larger, heavier tasks capable of running in the background as macro tasks. However, they had to queue for execution, leading to head-of-line blocking when significant sudden requests occurred.
Now, 3 priority levels (low, normal, high) have been introduced, for both micro and macro tasks. This finer granularity in task handling, and the introduction of new concurrency, allow high-priority tasks to preempt more resources. This will make Yazi more responsive.
The more important thing is that it also covers the Yazi plugin system, which will allow users to allocate different priority levels on demand for their preloader, previewer, and functional plugins.