This page lists synchronization invariants that hold in Chickadee. See also spinlocks.
A CPU’s run queue, which is implemented by members in
proc::runq_links_), is protected by
cpustate::runq_lock_. Reading or writing a CPU’s run queue requires that lock.
cpustate::current_is read-only, except that
cpustate::schedulecan modify it.
A process may be the current process for some CPU, and simultaneously on the run queue for that same CPU.
proc::yields_member may be accessed only by
A newly-initialized user process has a nonnull
proc::regs_pointer. It is safe to access that member and modify its contents, but only up to the point that the process is scheduled.
Running processes must not access their
proc::regs_members, except that if interrupts are disabled, the current process may set
proc::exception’s timer interrupt case.)
proc::yieldmust be called with no spinlocks held.
proc::yield_noreturnmust be called with no spinlocks held and with interrupts disabled.
cpustate::schedulemust be called with no spinlocks held and with interrupts disabled.
Read or write access to the process table
You may free a process’s page table pages only if (1) the process is not present in
ptable, or (2) the process’s page table lock is locked for writing (forcing