SimGrid  3.16
Versatile Simulation of Distributed Systems
simgrid::kernel::context::RawContext Class Reference

Detailed Description

Fast context switching inspired from SystemV ucontexts.

The main difference to the System V context is that Raw Contexts are much faster because they don't preserve the signal mask when switching. This saves a system call (at least on Linux) on each context switch.

Inheritance diagram for simgrid::kernel::context::RawContext:
simgrid::kernel::context::Context

Public Member Functions

 RawContext (std::function< void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
 
 ~RawContext () override
 
void stop () override
 
void suspend () override
 
void resume ()
 
- Public Member Functions inherited from simgrid::kernel::context::Context
 Context (std::function< void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
 
void operator() ()
 
bool has_code () const
 
smx_actor_t process ()
 
void set_cleanup (void_pfn_smxprocess_t cleanup)
 
virtual ~Context ()
 

Static Public Member Functions

static void wrapper (void *arg)
 

Protected Attributes

voidstack_ = nullptr
 
voidstack_top_ = nullptr
 pointer to top the stack stack More...
 

Additional Inherited Members

- Public Attributes inherited from simgrid::kernel::context::Context
bool iwannadie
 

Constructor & Destructor Documentation

◆ RawContext()

simgrid::kernel::context::RawContext::RawContext ( std::function< void()>  code,
void_pfn_smxprocess_t  cleanup_func,
smx_actor_t  process 
)

◆ ~RawContext()

simgrid::kernel::context::RawContext::~RawContext ( )
override

Member Function Documentation

◆ wrapper()

void simgrid::kernel::context::RawContext::wrapper ( void arg)
static

◆ stop()

void simgrid::kernel::context::RawContext::stop ( )
overridevirtual

Reimplemented from simgrid::kernel::context::Context.

◆ suspend()

void simgrid::kernel::context::RawContext::suspend ( )
overridevirtual

◆ resume()

void simgrid::kernel::context::RawContext::resume ( )

Member Data Documentation

◆ stack_

void* simgrid::kernel::context::RawContext::stack_ = nullptr
protected

◆ stack_top_

void* simgrid::kernel::context::RawContext::stack_top_ = nullptr
protected

pointer to top the stack stack


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