![]() |
The ROme OpTimistic Simulator
2.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
|
User-Level Threads. More...
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <stdbool.h>#include <arch/ult.h>#include <core/core.h>#include <scheduler/process.h>#include <mm/dymelor.h>
Include dependency graph for ult.c:Go to the source code of this file.
Functions | |
| void * | get_ult_stack (size_t size) |
Variables | |
| __thread kernel_context_t | kernel_context |
| This is the execution context of the simulation kernel. | |
User-Level Threads.
The User-Level Thread module allows the creation/scheduling of multiple co-routines which can yield the CPU to a different one, or that can be preƫmpted by some asynchronous event.
Due to the possibility of external preƫmption, ULTs store the whole CPU context in an ad-hoc buffer. This is a significant difference with respect standard facilities such as setjmp/longjmp which only store callee-save registers.
ULTs are used to implement both runtime-level routines (each worker thread has its own execution context) and model-level routines (each LP has its own execution context).
This file is part of ROOT-Sim (ROme OpTimistic Simulator).
ROOT-Sim is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; only version 3 of the License applies.
ROOT-Sim is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with ROOT-Sim; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Definition in file ult.c.
| void* get_ult_stack | ( | size_t | size | ) |
When this function is called, a zeroed page-aligned stack for the ULT is created and returned. The size of the stack can be specified by using the parameter. It's suggested to give a stack size which is a multiple of the page size. Nevertheless, no check is done by this function.
| size | The size of the requested stack |
Definition at line 65 of file ult.c.
Here is the call graph for this function: