Hi vityafx, thanks for this useful crate :)
I'm trying to set the highest real-time highest priority for low-latency audio operation.
let thread_id = thread_native_id();
set_thread_priority(thread_id,
ThreadPriority::Max,
ThreadSchedulePolicy::Realtime(RealtimeThreadSchedulePolicy::Fifo)).unwrap();
This always fails with: Err value: Pthread(22), whereas this is fine:
set_thread_priority(thread_id,
ThreadPriority::Min,
ThreadSchedulePolicy::Normal(NormalThreadSchedulePolicy::Normal)
Also this code has the result expected, but it's surprising to have a numeric value.
let policy = ThreadSchedulePolicy::Realtime(RealtimeThreadSchedulePolicy::Fifo);
let params = ScheduleParams { sched_priority: 3 };
set_thread_schedule_policy(thread_id, policy, params).unwrap();
How would you set the highest real-time priority ergonomically?
Hi vityafx, thanks for this useful crate :)
I'm trying to set the highest real-time highest priority for low-latency audio operation.
This always fails with:
Err value: Pthread(22), whereas this is fine:Also this code has the result expected, but it's surprising to have a numeric value.
How would you set the highest real-time priority ergonomically?