Expand description
Information about the current thread and current Shuttle execution.
This module provides access to information about the current Shuttle execution. It is useful for
building tools that need to exploit Shuttle’s total ordering of concurrent operations; for
example, a tool that wants to check linearizability might want access to a global timestamp for
events, which the context_switches function provides.
This module also provides functions to manage the assocation of labels to threads and async tasks.
Labels are typed values that can be associated with a task. They are useful for debugging: for
instance, the TaskName label can be set to assign names to tasks to make debug output easier to read.
Labels can also be used to build customized schedulers: for instance, they can be used to assign
numeric weights to tasks, which can be used to implement a priority-preemptive scheduler.
Re-exports§
pub use crate::runtime::task::labels::Labels;pub use crate::runtime::task::ChildLabelFn;pub use crate::runtime::task::TaskId;pub use crate::runtime::task::TaskName;pub use crate::runtime::task::Tag;Deprecated pub use crate::runtime::task::Taggable;Deprecated
Functions§
- clock
- Get the current thread’s vector clock
- clock_
for - Gets the clock for the thread with the given task ID
- context_
switches - The number of context switches that happened so far in the current Shuttle execution.
- get_
current_ task - Gets the
TaskIdof the current task, orNoneif there is no current task. - get_
label_ for_ task - Get a label of the given type for the specified task, if any
- get_
name_ for_ task - Get the debug name for a task
- get_
tag_ for_ current_ task Deprecated - Gets the
tagfield of the current task. - get_
tag_ for_ task Deprecated - Gets the
tagfield of the specified task. - me
- Get the
TaskIdof the current task. Panics if there is no current task. - remove_
label_ for_ task - Remove a label of the given type for the specified task, returning the old label for the type, if any
- reset_
step_ count - Sets the number of scheduling steps used (wrt. the step bound) to 0.
- set_
label_ for_ task - Add the given label to the specified task, returning the old label for the type, if any
- set_
name_ for_ task - Set the debug name for a task, returning the old name, if any
- set_
tag_ for_ current_ task Deprecated - Sets the
tagfield of the current task. Returns thetagwhich was there previously. - set_
tag_ for_ task Deprecated - Sets the
tagfield of the specified task. - with_
labels_ for_ task - Apply the given function to the Labels for the specified task