PatchworkOS  19e446b
A non-POSIX operating system.
Loading...
Searching...
No Matches
sched_t Struct Reference

Per-CPU scheduler. More...

#include <sched.h>

Collaboration diagram for sched_t:

Public Member Functions

 _Atomic (int64_t) totalWeight
 The total weight of all threads in the runqueue, not protected by the lock.
 
 _Atomic (uint64_t) preemptCount
 If greater than zero, preemption is disabled.
 

Data Fields

rbtree_t runqueue
 Contains all runnable threads, including the currently running thread, sorted by vdeadline.
 
vclock_t vtime
 The current virtual time of the CPU.
 
clock_t lastUpdate
 The real time when the last vtime update occurred.
 
lock_t lock
 The lock protecting the scheduler.
 
thread_t *volatile idleThread
 The idle thread for this CPU.
 
thread_t *volatile runThread
 The currently running thread on this CPU.
 

Detailed Description

Per-CPU scheduler.

Stored in a CPU's sched member.

Note
The runThread and idleThread members are declared volatile as they can be accessed in interrupt context as well as non-interrupt context.

Definition at line 397 of file sched.h.

Member Function Documentation

◆ _Atomic() [1/2]

sched_t::_Atomic ( int64_t  )

The total weight of all threads in the runqueue, not protected by the lock.

◆ _Atomic() [2/2]

sched_t::_Atomic ( uint64_t  )

If greater than zero, preemption is disabled.

Field Documentation

◆ runqueue

rbtree_t sched_t::runqueue

Contains all runnable threads, including the currently running thread, sorted by vdeadline.

Definition at line 400 of file sched.h.

◆ vtime

vclock_t sched_t::vtime

The current virtual time of the CPU.

Definition at line 401 of file sched.h.

◆ lastUpdate

clock_t sched_t::lastUpdate

The real time when the last vtime update occurred.

Definition at line 402 of file sched.h.

◆ lock

lock_t sched_t::lock

The lock protecting the scheduler.

Definition at line 403 of file sched.h.

◆ idleThread

thread_t* volatile sched_t::idleThread

The idle thread for this CPU.

Definition at line 405 of file sched.h.

◆ runThread

thread_t* volatile sched_t::runThread

The currently running thread on this CPU.

Definition at line 406 of file sched.h.


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