OOStuBS - Technische Informatik II (TI-II)
2.4
|
Storage for current context of thread. Mehr ...
#include <context.h>
Öffentliche Methoden | |
Context (Thread *thread) | |
Context creation. | |
void | set () |
replaces the currently running context with this one | |
void | swap (Context &next) |
swaps the currently running context with the specified one |
Private Typen | |
typedef void * | Register |
Definition of a storage type able to hold CPU register contents. | |
enum | RegisterIndices { ebx = 0, esi = 1, edi = 2, esp = 3, ebp = 4 } |
Index enumeration mapping registers to indices of the registers array. Mehr ... |
Private Attribute | |
Register | registers [5] |
the non-volatile x86 base registers | |
Register | stack [1024] |
Local 1K stack of this thread. |
Storage for current context of thread.
This class contains all information needed to represent a thread of execution. It may be used to stop, switch and continue currently running threads.
|
private |
|
private |
Context::Context | ( | Thread * | thread | ) |
Context creation.
On construction of the context the CPU registers will be filled with appropriate information, to start the thread on its first scheduling
thread | pointer to thread object |
Definiert in Zeile 4 der Datei context.cc.
void Context::set | ( | ) |
replaces the currently running context with this one
This method does not preserve the old context. Therefore the current execution state of the originating thread is lost.
Definiert in Zeile 11 der Datei context.cc.
void Context::swap | ( | Context & | next | ) |
swaps the currently running context with the specified one
During the swap process the registers of the currently active context will be updated with the actualk values contained in the CPU.
next | the next context to be run by the CPU |
Definiert in Zeile 22 der Datei context.cc.
|
private |
|
private |