#thread #schedule #priority #pthread

thread-priority

Library for managing threads priority and schedule policies

7 releases

0.2.4 Jun 2, 2021
0.2.3 Jun 2, 2021
0.2.1 Nov 10, 2020
0.2.0 Mar 23, 2020
0.1.0 Jun 22, 2017

#90 in Concurrency

Download history 484/week @ 2021-07-01 659/week @ 2021-07-08 673/week @ 2021-07-15 616/week @ 2021-07-22 519/week @ 2021-07-29 1122/week @ 2021-08-05 901/week @ 2021-08-12 817/week @ 2021-08-19 562/week @ 2021-08-26 455/week @ 2021-09-02 522/week @ 2021-09-09 512/week @ 2021-09-16 520/week @ 2021-09-23 593/week @ 2021-09-30 558/week @ 2021-10-07 444/week @ 2021-10-14

2,060 downloads per month
Used in 3 crates

MIT license

26KB
379 lines

thread-priority

CI Crates Docs MIT licensed

A simple library to control thread schedule policies and thread priority.

This crate does not support all the plaforms yet but it is inteded to be developed so, so feel free to contribute!

Supported platforms

  • Linux
  • Windows

Example

Setting current thread's priority to minimum:

use thread_priority::*;

fn main() {
    assert!(set_current_thread_priority(ThreadPriority::Min).is_ok());
}

License

This project is licensed under the MIT license.


lib.rs:

Thread priority. A library for changing thread's priority.

Usage

Setting thread priority to minimum:

use thread_priority::*;

assert!(set_current_thread_priority(ThreadPriority::Min).is_ok());
// Or like this:
assert!(ThreadPriority::Min.set_for_current().is_ok());

Dependencies

~34KB