SIMLIB/C++
3.07
|
Implementation of quasiparallel processes (coroutines) More...
Go to the source code of this file.
Classes | |
struct | simlib3::P_Context_t |
internal structure for storing of process context More... | |
Namespaces | |
simlib3 | |
Implementation of class CalendarList interface is static - using global functions in SQS namespace. | |
Macros | |
#define | EXTRA_DEBUG 0 |
#define | THREAD_DEBUG(n) |
#define | THREAD_INTERRUPT() |
interrupt process behavior execution, continue after return More... | |
#define | THREAD_EXIT() longjmp(P_DispatcherStatusBuffer, 2) |
does not save context More... | |
#define | ALLOC_CONTEXT(sz) |
allocate memory for process context, sz = size of stack area to save More... | |
#define | CANARY1 (reinterpret_cast<long>(this)+1) |
#define | STACK_RESERVED 0x080 |
#define | CANARY2 0xDEADBEEFUL |
Functions | |
static void | simlib3::THREAD_INTERRUPT_f () __attribute__((noinline)) |
Special function called from Process::Behavior() directly or indirectly. More... | |
static void | simlib3::FREE_CONTEXT () __attribute__((noinline)) |
non-inline function for deallocating saved process context More... | |
Variables | |
static jmp_buf | simlib3::P_DispatcherStatusBuffer |
setjmp() state before dispatch More... | |
static char *volatile | simlib3::P_StackBase = 0 |
global start of stack area More... | |
static char *volatile | simlib3::P_StackBase2 = 0 |
for checking start of stack More... | |
static P_Context_t *volatile | simlib3::P_Context = 0 |
temporary global process state More... | |
static volatile size_t | simlib3::P_StackSize = 0 |
temporary global stack size More... | |
Implementation of quasiparallel processes (coroutines)
This module contains implementation of cooperative multitasking processes for discrete simulation
Definition in file process.cc.
#define ALLOC_CONTEXT | ( | sz | ) |
allocate memory for process context, sz = size of stack area to save
Definition at line 226 of file process.cc.
Referenced by simlib3::THREAD_INTERRUPT_f().
#define CANARY1 (reinterpret_cast<long>(this)+1) |
Definition at line 430 of file process.cc.
Referenced by simlib3::Process::_Run().
#define CANARY2 0xDEADBEEFUL |
Definition at line 582 of file process.cc.
Referenced by simlib3::THREAD_INTERRUPT_f().
#define EXTRA_DEBUG 0 |
Definition at line 139 of file process.cc.
#define STACK_RESERVED 0x080 |
Referenced by simlib3::Process::_Run().
#define THREAD_DEBUG | ( | n | ) |
Definition at line 199 of file process.cc.
Referenced by simlib3::Process::_Run(), and simlib3::THREAD_INTERRUPT_f().
#define THREAD_EXIT | ( | ) | longjmp(P_DispatcherStatusBuffer, 2) |
does not save context
Definition at line 219 of file process.cc.
Referenced by simlib3::Process::Terminate().
#define THREAD_INTERRUPT | ( | ) |
interrupt process behavior execution, continue after return
Definition at line 209 of file process.cc.
Referenced by simlib3::Process::Activate(), simlib3::Process::Interrupt(), simlib3::Process::Passivate(), and simlib3::Process::Wait().