pub struct SchedIdentity {
pub pid_to_task: BTreeMap<Pid, TaskId>,
pub tid_to_task: BTreeMap<Tid, TaskId>,
pub pid_to_pgid: BTreeMap<Pid, Pid>,
pub pid_to_sid: BTreeMap<Pid, Pid>,
pub pgid_members: BTreeMap<Pid, Vec<TaskId>>,
pub sid_members: BTreeMap<Pid, Vec<TaskId>>,
pub parent_of: BTreeMap<TaskId, TaskId>,
pub children_of: BTreeMap<TaskId, Vec<TaskId>>,
}Expand description
Identity maps for the scheduler: PID/TID routing, process groups, session membership, and parent/child relationships.
Lives behind the SCHED_IDENTITY lock, separate from GLOBAL_SCHED_STATE
so that syscall lookups (getpid, getpgid, setpgid, setsid, etc.)
never contend with fork/exit or block/wake paths.
Fields§
§pid_to_task: BTreeMap<Pid, TaskId>Map userspace PID -> internal TaskId (process leader in current model).
tid_to_task: BTreeMap<Tid, TaskId>Map userspace TID -> internal TaskId (fast thread lookup).
pid_to_pgid: BTreeMap<Pid, Pid>Map PID -> process group id.
pid_to_sid: BTreeMap<Pid, Pid>Map PID -> session id.
pgid_members: BTreeMap<Pid, Vec<TaskId>>Group membership index: pgid -> task ids.
sid_members: BTreeMap<Pid, Vec<TaskId>>Session membership index: sid -> task ids.
parent_of: BTreeMap<TaskId, TaskId>Parent relationship: child -> parent
children_of: BTreeMap<TaskId, Vec<TaskId>>Children list: parent -> children
Implementations§
Source§impl SchedIdentity
impl SchedIdentity
Auto Trait Implementations§
impl Freeze for SchedIdentity
impl RefUnwindSafe for SchedIdentity
impl Send for SchedIdentity
impl Sync for SchedIdentity
impl Unpin for SchedIdentity
impl UnsafeUnpin for SchedIdentity
impl UnwindSafe for SchedIdentity
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more