|
SIMLIB/C++ 3.09
|
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::Behavior() context More... | |
Namespaces | |
| namespace | simlib3 |
| Implementation of class CalendarList interface is static - using global functions in SQS namespace. | |
Macros | |
| #define | EXTRA_DEBUG 0 |
| #define | DEBUG_PROCESS(n) |
| #define | PROCESS_INTERRUPT() |
| interrupt process behavior execution, continue after return | |
| #define | PROCESS_EXIT() longjmp(P_DispatcherStatusBuffer, 2) |
| does not save context | |
| #define | CANARY1 (reinterpret_cast<long>(this)-1) |
| #define | MAX_PROCESS_STACK_SIZE 1000000UL |
| This is theoretical max stack size for single SIMLIB Process at time of interruption (should never be too big, because of copying the stack contents) FIXME: should be checked at Process::Behavior interrupt for more precise error message. | |
| #define | STACK_RESERVED 0x080 |
| #define | CANARY2 0xDEADBEEFUL |
Functions | |
| static void | simlib3::PROCESS_INTERRUPT_f () |
| Special function called from Process::Behavior() directly or indirectly. | |
| static void | simlib3::ALLOC_CONTEXT (size_t sz) noexcept |
| static void | simlib3::FREE_CONTEXT () noexcept |
| deallocate saved process context | |
| static void | simlib3::restore_context2 (volatile char *) noexcept |
| This function overwrites stack contents. It never returns, see longjmp. | |
| static void | simlib3::restore_context (size_t data_size) noexcept |
| This elliminates the need for explicit stack pointer adjustment. | |
Variables | |
| static jmp_buf | simlib3::P_DispatcherStatusBuffer |
| setjmp() state before dispatch | |
| static char *volatile | simlib3::P_StackBase = 0 |
| global start of stack area | |
| static char *volatile | simlib3::P_StackBase2 = 0 |
| used for checking only | |
| static P_Context_t *volatile | simlib3::P_Context = 0 |
| temporary global process state | |
| static volatile size_t | simlib3::P_StackSize = 0 |
| temporary global stack size | |
Implementation of quasiparallel processes (coroutines)
This module contains implementation of cooperative multitasking processes for discrete simulation
Definition in file process.cc.
| #define CANARY1 (reinterpret_cast<long>(this)-1) |
Definition at line 352 of file process.cc.
| #define CANARY2 0xDEADBEEFUL |
Definition at line 538 of file process.cc.
| #define DEBUG_PROCESS | ( | n | ) |
Definition at line 128 of file process.cc.
| #define EXTRA_DEBUG 0 |
Definition at line 79 of file process.cc.
| #define MAX_PROCESS_STACK_SIZE 1000000UL |
This is theoretical max stack size for single SIMLIB Process at time of interruption (should never be too big, because of copying the stack contents) FIXME: should be checked at Process::Behavior interrupt for more precise error message.
Definition at line 358 of file process.cc.
| #define PROCESS_EXIT | ( | ) | longjmp(P_DispatcherStatusBuffer, 2) |
does not save context
Definition at line 148 of file process.cc.
| #define PROCESS_INTERRUPT | ( | ) |
interrupt process behavior execution, continue after return
Definition at line 138 of file process.cc.
| #define STACK_RESERVED 0x080 |