STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions
stapl::runtime::stack Class Reference

Thread stack information object. More...

Public Member Functions

 stack (stack const &)=delete
 
stackoperator= (stack const &)=delete
 
void add_runqueue (runqueue::impl &rq)
 Adds a runqueue to the stack.
 
contexttop (void)
 Returns the context on the top of the stack. More...
 
contexttry_top (void)
 Returns a pointer to the context on the top of the stack. More...
 
contextpeek (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.
 
contextbase_of_top ()
 Returns the base context of the context at the top of the stack.
 
location_mdtry_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)
 

Detailed Description

Thread stack information object.

Member Function Documentation

◆ top()

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.

Warning
If this function encounters a gang of one location without initialized metadata, it will create the required metadata. Since the creation of the metadata requires information about the parent gang id, this may lead to a recursive call to top() until fully initialized location metadata is encountered.

◆ try_top()

context* stapl::runtime::stack::try_top ( void  )

Returns a pointer to the context on the top of the stack.

If the context creation was deferred, then it returns nullptr.

◆ peek()

context* stapl::runtime::stack::peek ( void  ) const
noexcept

Returns a pointer to the context on the top of the stack.

If the context creation was deferred, then it returns nullptr.

◆ switch_to()

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.


The documentation for this class was generated from the following file: