Multiple priority scheduler (#44575)
Improves the scheduler by allowing tasks to have a set priority which will significantly improve responsiveness. Release notes: - N/A --------- Co-authored-by: Yara <git@yara.blue>
This commit is contained in:
@@ -22,7 +22,8 @@ use git::{
|
||||
COMMIT_MESSAGE, DOT_GIT, FSMONITOR_DAEMON, GITIGNORE, INDEX_LOCK, LFS_DIR, status::GitSummary,
|
||||
};
|
||||
use gpui::{
|
||||
App, AppContext as _, AsyncApp, BackgroundExecutor, Context, Entity, EventEmitter, Task,
|
||||
App, AppContext as _, AsyncApp, BackgroundExecutor, Context, Entity, EventEmitter, Priority,
|
||||
Task,
|
||||
};
|
||||
use ignore::IgnoreStack;
|
||||
use language::DiskState;
|
||||
@@ -4123,7 +4124,7 @@ impl BackgroundScanner {
|
||||
|
||||
let progress_update_count = AtomicUsize::new(0);
|
||||
self.executor
|
||||
.scoped(|scope| {
|
||||
.scoped_priority(Priority::Low, |scope| {
|
||||
for _ in 0..self.executor.num_cpus() {
|
||||
scope.spawn(async {
|
||||
let mut last_progress_update_count = 0;
|
||||
|
||||
Reference in New Issue
Block a user