SimGrid  3.18
Versatile Simulation of Distributed Systems
simgrid::kernel::context::RawContext Class Referenceabstract

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.

#include <ContextRaw.hpp>

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

Public Member Functions

 RawContext (std::function< void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
 
 ~RawContext () override
 
void stop () override
 
virtual void resume ()=0
 
- 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 ()
 
virtual void suspend ()=0
 

Static Public Member Functions

static void swap (RawContext *from, RawContext *to)
 
static RawContextgetMaestro ()
 
static void setMaestro (RawContext *maestro)
 

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

◆ stop()

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

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

◆ resume()

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

◆ swap()

void simgrid::kernel::context::RawContext::swap ( RawContext from,
RawContext to 
)
inlinestatic

◆ getMaestro()

static RawContext* simgrid::kernel::context::RawContext::getMaestro ( )
inlinestatic

◆ setMaestro()

static void simgrid::kernel::context::RawContext::setMaestro ( RawContext maestro)
inlinestatic

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