#audio #thread #priority #bump #linux

audio_thread_priority

Bump a thread to real-time priority, for audio work, on Linux, Windows and macOS

21 breaking releases

✓ Uses Rust 2018 edition

0.22.1 Apr 27, 2020
0.22.0 Jan 31, 2020
0.21.1 Apr 27, 2020
0.21.0 Nov 4, 2019
0.3.0 Jan 25, 2018

#52 in Audio

Download history 31/week @ 2020-01-25 27/week @ 2020-02-01 52/week @ 2020-02-08 103/week @ 2020-02-15 146/week @ 2020-02-22 20/week @ 2020-02-29 85/week @ 2020-03-07 52/week @ 2020-03-14 106/week @ 2020-03-21 58/week @ 2020-03-28 50/week @ 2020-04-04 189/week @ 2020-04-11 19/week @ 2020-04-18 61/week @ 2020-04-25 30/week @ 2020-05-02 20/week @ 2020-05-09

313 downloads per month

MPL-2.0 license

45KB
846 lines

audio_thread_priority

Synopsis:

  // ... on a thread that will compute audio and has to be real-time:
  RtPriorityHandle handle;

  match promote_current_thread_to_real_time(512, 44100) {
    Ok(h) => {
      handle = h;
      println!("this thread is now bumped to real-time priority.") 
    }
    Err(...) => { println!("could not bump to real time.") }
  }

  // do some real-time work.

  match demote_current_thread_from_real_time(h) {
    Ok(...) => {
      println!("this thread is now bumped back to normal.")
    }
    Err(...) => {
      println!("Could not bring the thread back to normal priority.")
    }
  }

This library can also be used from C or C++ using the included header and compiling the rust code in the application. By default, a .a is compiled to ease linking.

License

MPL-2

Dependencies

~52–305KB