pub enum SchedulingPolicy {
    Other(i8),
    Idle,
    Batch(i8),
    FIFO(u8),
    RR(u8),
    Deadline(u64u64u64),
}
Expand description

Different Linux scheduling policies, intended to be paired with a priority number in the builder function polling_thread_priority of ProgramGroup.

Variants

Other(i8)

The default Linux scheduling technique. When paired with a priority number, the priority number will be interpreted as a niceness value (-20 to 19, inclusive).

Idle

The lowest possible priority on the system. This cannot be modified by a niceness value, and provided numbers will be ignored.

Batch(i8)

Similar to Other, except the scheduler will always assume this thread is CPU-intensive for scheduling purposes. Any provided priority number will be interpreted as a niceness value (-20 to 19, inclusive).

FIFO(u8)

Use first-in-first-out scheduling for this thread. The provided priority value will be the thread’s overall priority (0 to 99, inclusive). Note that the polling thread will not be preempted (unless by a higher priority process) when using this policy, until it finishes processing a batch and blocks on polling.

RR(u8)

A Round-Robin modification of the FIFO scheduling policy that preempts the process after reaching some maximum time quantum limit, and puts it at the back of the queue. The provided priority should be the same as FIFO (0 to 99, inclusive).

Deadline(u64u64u64)

The deadline policy attempts to finish periodic jobs by a certain deadline. It takes three numbers: the job’s expected runtime, the job’s deadline time, and the job’s period, all in nanoseconds. See the following diagram from the sched manpage:

 arrival/wakeup                    absolute deadline
      |    start time                    |
      |        |                         |
      v        v                         v
 -----x--------xooooooooooooooooo--------x--------x---
               |<-- Runtime ------->|
      |<----------- Deadline ----------->|
      |<-------------- Period ------------------->|

The provided priority number will be interpreted as the estimated runtime, the deadline, and the period (the kernel enforces runtime <= deadline <= period).

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.