PatchworkOS  da8a090
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.
 

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 392 of file sched.h.

Member Function Documentation

◆ _Atomic()

sched_t::_Atomic ( int64_t  )

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

Field Documentation

◆ runqueue

rbtree_t sched_t::runqueue

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

Definition at line 395 of file sched.h.

◆ vtime

vclock_t sched_t::vtime

The current virtual time of the CPU.

Definition at line 396 of file sched.h.

◆ lastUpdate

clock_t sched_t::lastUpdate

The real time when the last vtime update occurred.

Definition at line 397 of file sched.h.

◆ lock

lock_t sched_t::lock

The lock protecting the scheduler.

Definition at line 398 of file sched.h.

◆ idleThread

thread_t* volatile sched_t::idleThread

The idle thread for this CPU.

Definition at line 399 of file sched.h.

◆ runThread

thread_t* volatile sched_t::runThread

The currently running thread on this CPU.

Definition at line 400 of file sched.h.


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