#[repr(C)]pub struct TaskWorkItem {Show 16 fields
pub state: u32,
pub op_handle: u32,
pub tenant_id: u32,
pub priority: u32,
pub input_handle: u32,
pub output_handle: u32,
pub param: u32,
pub continuation_pc: u32,
pub continuation_data: u32,
pub resume_epoch: u32,
pub task_id: u32,
pub parent_task_id: u32,
pub age_ticks: u32,
pub requeue_count: u32,
pub yield_count: u32,
pub flags: u32,
}Expand description
One device-visible continuation task slot.
The first four words match the persistent ring header:
status, opcode, tenant, priority. The remaining twelve words are the slot
payload. Words 4..6 preserve the legacy MegakernelWorkItem payload; words 7..15
carry continuation and scheduler state.
Fields§
§state: u32Raw TaskState word.
op_handle: u32Stable op id index into the dialect registry.
tenant_id: u32Tenant id checked by the runtime scheduler.
priority: u32Raw TaskPriority word.
input_handle: u32Input-buffer handle.
output_handle: u32Output-buffer handle.
param: u32Per-item parameter word.
continuation_pc: u32Program counter or block id where the worker should resume.
continuation_data: u32Opaque continuation-local scratch word.
resume_epoch: u32Device-visible epoch at which the task may resume.
task_id: u32Stable task id used to join yielded/requeued continuations.
parent_task_id: u32Parent task id for split or fan-out work; zero when absent.
age_ticks: u32Scheduler age ticks accumulated while waiting.
requeue_count: u32Number of times this task has been requeued.
yield_count: u32Number of times this task has yielded.
flags: u32Bitset of TASK_FLAG_* continuation flags.
Implementations§
Source§impl TaskWorkItem
impl TaskWorkItem
Sourcepub const fn from_work_item(
task_id: u32,
tenant_id: u32,
priority: TaskPriority,
item: MegakernelWorkItem,
) -> Self
pub const fn from_work_item( task_id: u32, tenant_id: u32, priority: TaskPriority, item: MegakernelWorkItem, ) -> Self
Construct a ready continuation task from the compact legacy work item.
Sourcepub const fn work_item(&self) -> MegakernelWorkItem
pub const fn work_item(&self) -> MegakernelWorkItem
Return the compact legacy work item payload carried by this task.
Sourcepub const fn task_state(&self) -> Option<TaskState>
pub const fn task_state(&self) -> Option<TaskState>
Decode the task state word.
Sourcepub const fn task_priority(&self) -> Option<TaskPriority>
pub const fn task_priority(&self) -> Option<TaskPriority>
Decode the task priority word.
Sourcepub const fn is_schedulable(&self) -> bool
pub const fn is_schedulable(&self) -> bool
Return true when the task is eligible to be claimed by a worker.
Sourcepub const fn paused(
self,
continuation_pc: u32,
continuation_data: u32,
resume_epoch: u32,
) -> Self
pub const fn paused( self, continuation_pc: u32, continuation_data: u32, resume_epoch: u32, ) -> Self
Encode a pause at continuation_pc until resume_epoch.
Sourcepub const fn yielded(self, continuation_pc: u32, continuation_data: u32) -> Self
pub const fn yielded(self, continuation_pc: u32, continuation_data: u32) -> Self
Yield this task back to the scheduler at continuation_pc.
Sourcepub const fn requeued(
self,
continuation_pc: u32,
continuation_data: u32,
priority: TaskPriority,
) -> Self
pub const fn requeued( self, continuation_pc: u32, continuation_data: u32, priority: TaskPriority, ) -> Self
Requeue this task, optionally changing its priority partition.
Trait Implementations§
Source§impl Clone for TaskWorkItem
impl Clone for TaskWorkItem
Source§fn clone(&self) -> TaskWorkItem
fn clone(&self) -> TaskWorkItem
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TaskWorkItem
Source§impl Debug for TaskWorkItem
impl Debug for TaskWorkItem
impl Eq for TaskWorkItem
Source§impl PartialEq for TaskWorkItem
impl PartialEq for TaskWorkItem
Source§fn eq(&self, other: &TaskWorkItem) -> bool
fn eq(&self, other: &TaskWorkItem) -> bool
self and other values to be equal, and is used by ==.impl Pod for TaskWorkItem
impl StructuralPartialEq for TaskWorkItem
Auto Trait Implementations§
impl Freeze for TaskWorkItem
impl RefUnwindSafe for TaskWorkItem
impl Send for TaskWorkItem
impl Sync for TaskWorkItem
impl Unpin for TaskWorkItem
impl UnsafeUnpin for TaskWorkItem
impl UnwindSafe for TaskWorkItem
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.