A cross-platform Rust library for controlling thread scheduling policies and priorities across multiple operating systems.
thread-priority is a Rust library that provides a cross-platform API for controlling thread scheduling policies and priorities. It abstracts away OS-specific differences, allowing developers to manage thread execution characteristics consistently across Linux, Windows, macOS, BSD variants, and mobile platforms.
Rust developers building concurrent applications that require fine-grained control over thread scheduling, such as real-time systems, game engines, or performance-sensitive services.
It offers a unified, safe interface to platform-specific thread priority APIs, eliminating the need for conditional compilation or manual FFI bindings, while maintaining full control over scheduling behavior.
A simple Cross-platform thread schedule and priority library for rust.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a unified API for Linux, Windows, macOS, and multiple BSD variants, as listed in the README's supported platforms, eliminating OS-specific code.
Extends Rust's std::thread::Builder with ThreadBuilderExt trait, allowing priority setting during thread creation, as shown in examples like spawn_with_priority.
Offers ThreadExt trait methods to easily get and set the priority of the current thread, demonstrated in examples with get_priority and get_native_id.
Supports both platform-agnostic values (Min, Max, Crossplatform) and OS-specific enums, enabling detailed scheduling control across systems.
Features like thread ideal processor assignment are limited to Windows (e.g., set_thread_ideal_processor in examples), indicating incomplete cross-platform coverage for affinity control.
Requires Rust 1.67.1 or 1.85, with compatibility adjustments for older versions, as noted in the README, potentially hindering adoption in legacy projects.
Focuses solely on thread scheduling priorities without built-in thread pooling or task scheduling, which might require additional libraries for comprehensive concurrency.