Thread stack information object. More...
Public Member Functions | |
stack (stack const &)=delete | |
stack & | operator= (stack const &)=delete |
void | add_runqueue (runqueue::impl &rq) |
Adds a runqueue to the stack. | |
context & | top (void) |
Returns the context on the top of the stack. More... | |
context * | try_top (void) |
Returns a pointer to the context on the top of the stack. More... | |
context * | peek (void) const noexcept |
Returns a pointer to the context on the top of the stack. More... | |
void | push_base (context &ctx) |
Pushes a base context on the stack and makes its runqueue active. | |
void | pop_base (void) |
Pops a base context from the stack. | |
void | push_placeholder (boost::optional< context > &pl) |
Pushes a placeholder for a new context on the stack. | |
void | switch_to (location_md &l, boost::optional< context > &pl) |
Switches to the base context of l . More... | |
void | pop_placeholder (void) |
Pops the placeholder from the stack. | |
void | push (context &ctx) |
Pushes ctx on the top of the stack. | |
void | pop (void) |
Pops the context from the top of the stack. | |
context & | base_of_top () |
Returns the base context of the context at the top of the stack. | |
location_md * | try_get_location_md (const gang_id gid) noexcept |
Returns a pointer to the location metadata of the gang gid if it is in the stack, otherwise nullptr . | |
runqueue::yield_status | yield (const bool light_yield=false) |
Thread stack information object.
context& stapl::runtime::stack::top | ( | void | ) |
Returns the context on the top of the stack.
If the context creation was deferred (e.g. one location gangs defer the creation of metadata) then this function will create all the required metadata and return the associated context object.
If the location metadata is already known (e.g. during gang switching) then it will be used to create the context.
context* stapl::runtime::stack::try_top | ( | void | ) |
|
noexcept |
void stapl::runtime::stack::switch_to | ( | location_md & | l, |
boost::optional< context > & | pl | ||
) |
Switches to the base context of l
.
The location metadata l
will be used to either create a new base context in pl
or to switch to an existing one.