Add proof-of-concept QoS implementation

This commit is contained in:
Luna Razzaghipour 2023-05-20 22:29:32 +10:00
parent bb78059be4
commit ca6461c143
No known key found for this signature in database
14 changed files with 254 additions and 23 deletions

View file

@ -77,7 +77,7 @@ impl fmt::Display for FlycheckConfig {
pub struct FlycheckHandle {
// XXX: drop order is significant
sender: Sender<StateChange>,
_thread: jod_thread::JoinHandle,
_thread: stdx::thread::JoinHandle,
id: usize,
}
@ -90,7 +90,7 @@ impl FlycheckHandle {
) -> FlycheckHandle {
let actor = FlycheckActor::new(id, sender, config, workspace_root);
let (sender, receiver) = unbounded::<StateChange>();
let thread = jod_thread::Builder::new()
let thread = stdx::thread::Builder::new(stdx::thread::QoSClass::Utility)
.name("Flycheck".to_owned())
.spawn(move || actor.run(receiver))
.expect("failed to spawn thread");
@ -395,7 +395,7 @@ struct CargoHandle {
/// The handle to the actual cargo process. As we cannot cancel directly from with
/// a read syscall dropping and therefore terminating the process is our best option.
child: JodGroupChild,
thread: jod_thread::JoinHandle<io::Result<(bool, String)>>,
thread: stdx::thread::JoinHandle<io::Result<(bool, String)>>,
receiver: Receiver<CargoMessage>,
}
@ -409,7 +409,7 @@ impl CargoHandle {
let (sender, receiver) = unbounded();
let actor = CargoActor::new(sender, stdout, stderr);
let thread = jod_thread::Builder::new()
let thread = stdx::thread::Builder::new(stdx::thread::QoSClass::Utility)
.name("CargoHandle".to_owned())
.spawn(move || actor.run())
.expect("failed to spawn thread");