Enum NormalThreadSchedulePolicy
pub enum NormalThreadSchedulePolicy {
Idle,
Batch,
Other,
}target_os=vxworks or NetBSD or Android or WebAssembly only.Expand description
Normal (non-realtime) schedule policies
For these schedule policies, niceness
is used.
Variants§
Idle
For running very low priority background jobs.
(Since Linux 2.6.23.) SCHED_IDLE can be used only at static priority 0;
the process nice value has no influence for this policy.
This policy is intended for running jobs at extremely low priority (lower even than a +19 nice value with the SCHED_OTHER or SCHED_BATCH policies).
Batch
For “batch” style execution of processes.
(Since Linux 2.6.16.) SCHED_BATCH can be used only at static priority 0.
This policy is similar to SCHED_OTHER in that it schedules the thread
according to its dynamic priority (based on the nice value). The difference is
that this policy will cause the scheduler to always assume that the thread is
CPU-intensive. Consequently, the scheduler will apply a small scheduling penalty
with respect to wakeup behavior, so that this thread is mildly disfavored in scheduling decisions.
This policy is useful for workloads that are noninteractive, but do not want to lower their nice value, and for workloads that want a deterministic scheduling policy without interactivity causing extra preemptions (between the workload’s tasks).
Other
The standard round-robin time-sharing policy, also sometimes referred to as “Normal”.
SCHED_OTHER can be used at only static priority 0 (i.e., threads under real-time policies
always have priority over SCHED_OTHER processes). SCHED_OTHER is the standard Linux
time-sharing scheduler that is intended for all threads that do not require the special
real-time mechanisms.
The thread to run is chosen from the static priority 0 list based on a dynamic priority that is determined only inside this list. The dynamic priority is based on the nice value (see below) and is increased for each time quantum the thread is ready to run, but denied to run by the scheduler.
This ensures fair progress among all SCHED_OTHER threads.
In the Linux kernel source code, the SCHED_OTHER policy is actually named SCHED_NORMAL.
Trait Implementations§
§impl Clone for NormalThreadSchedulePolicy
impl Clone for NormalThreadSchedulePolicy
§fn clone(&self) -> NormalThreadSchedulePolicy
fn clone(&self) -> NormalThreadSchedulePolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for NormalThreadSchedulePolicy
impl Debug for NormalThreadSchedulePolicy
§impl Hash for NormalThreadSchedulePolicy
impl Hash for NormalThreadSchedulePolicy
§impl Ord for NormalThreadSchedulePolicy
impl Ord for NormalThreadSchedulePolicy
§fn cmp(&self, other: &NormalThreadSchedulePolicy) -> Ordering
fn cmp(&self, other: &NormalThreadSchedulePolicy) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialEq for NormalThreadSchedulePolicy
impl PartialEq for NormalThreadSchedulePolicy
§impl PartialOrd for NormalThreadSchedulePolicy
impl PartialOrd for NormalThreadSchedulePolicy
impl Copy for NormalThreadSchedulePolicy
impl Eq for NormalThreadSchedulePolicy
impl StructuralPartialEq for NormalThreadSchedulePolicy
Auto Trait Implementations§
impl Freeze for NormalThreadSchedulePolicy
impl RefUnwindSafe for NormalThreadSchedulePolicy
impl Send for NormalThreadSchedulePolicy
impl Sync for NormalThreadSchedulePolicy
impl Unpin for NormalThreadSchedulePolicy
impl UnsafeUnpin for NormalThreadSchedulePolicy
impl UnwindSafe for NormalThreadSchedulePolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
Idle: 0 bytesBatch: 0 bytesOther: 0 bytes