2 releases (1 stable)

1.0.0 Nov 16, 2023
0.1.0 Oct 29, 2023

#18 in #low

Download history 3/week @ 2024-03-08 2/week @ 2024-03-15 11/week @ 2024-03-29 1/week @ 2024-04-05

71 downloads per month

MIT license

4KB

Low Priority Thread

CI crates.io docs.rs

This is a 1-function crate that sets the calling thread's priority to the lowest platform-specific value possible.

// Set the current thread to the lowest priority.
//
// This function returns () and will never fail.
lpt::lpt();

Windows

Uses SetThreadPriority() with THREAD_PRIORITY_IDLE (-15).

Unix

Uses libc::nice() with the max nice level.

  • On macOS and *BSD: +20
  • On Linux: +19

Dependencies

~0–36MB
~529K SLoC