PatchworkOS
Loading...
Searching...
No Matches
sched_thread_ctx_t Struct Reference

Per-thread scheduling context. More...

#include <sched.h>

Data Fields

clock_t timeSlice
 The length of the threads time slice, used to determine its deadline when its scheduled.
 
clock_t deadline
 The time when the time slice will actually expire, only valid while the thread is running.
 
priority_t actualPriority
 The actual priority of the thread.
 
clock_t recentBlockTime
 The amount of time within the last CONFIG_MAX_RECENT_BLOCK_TIME nanoseconds that the thread was blocking.
 
clock_t prevBlockCheck
 The previous time when the recentBlockTime member was updated.
 

Detailed Description

Per-thread scheduling context.

The sched_thread_ctx_t structure stores scheduling context for each thread.

Definition at line 55 of file sched.h.

Field Documentation

◆ actualPriority

priority_t sched_thread_ctx_t::actualPriority

The actual priority of the thread.

Based of the processes priority, but with some dynamic changes determined by if the thread is IO bound or CPU bound.

Definition at line 72 of file sched.h.

Referenced by sched_compute_actual_priority(), sched_invoke(), sched_load_balance(), sched_push(), sched_push_new_thread(), sched_queues_push(), sched_should_notify(), and sched_thread_ctx_init().

◆ deadline

clock_t sched_thread_ctx_t::deadline

The time when the time slice will actually expire, only valid while the thread is running.

Definition at line 64 of file sched.h.

Referenced by init_early(), sched_compute_time_slice(), sched_done_with_boot_thread(), sched_invoke(), sched_thread_ctx_init(), and sched_yield().

◆ prevBlockCheck

clock_t sched_thread_ctx_t::prevBlockCheck

The previous time when the recentBlockTime member was updated.

Definition at line 84 of file sched.h.

Referenced by sched_thread_ctx_init(), and sched_update_recent_idle_time().

◆ recentBlockTime

clock_t sched_thread_ctx_t::recentBlockTime

The amount of time within the last CONFIG_MAX_RECENT_BLOCK_TIME nanoseconds that the thread was blocking.

Used to determine its actual priority.

Definition at line 80 of file sched.h.

Referenced by sched_compute_actual_priority(), sched_thread_ctx_init(), and sched_update_recent_idle_time().

◆ timeSlice

clock_t sched_thread_ctx_t::timeSlice

The length of the threads time slice, used to determine its deadline when its scheduled.

Definition at line 60 of file sched.h.

Referenced by sched_compute_time_slice(), and sched_thread_ctx_init().


The documentation for this struct was generated from the following file: