Crates.io | lpt |
lib.rs | lpt |
version | 1.0.0 |
source | src |
created_at | 2023-10-29 17:39:46.664222 |
updated_at | 2023-11-16 20:26:54.903475 |
description | Low priority thread |
homepage | |
repository | https://github.com/hinto-janai/lpt |
max_upload_size | |
id | 1017643 |
size | 5,950 |
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();
Uses SetThreadPriority()
with THREAD_PRIORITY_IDLE
(-15
).
Uses libc::nice()
with the max nice level.
macOS
and *BSD
: +20
Linux
: +19