|
jaffarCommon
|
#include <dethreader.hpp>
Classes | |
| class | Thread |
Public Member Functions | |
| __JAFFAR_COMMON__INLINE__ threadId_t | createThread (const threadFc_t fc) |
| __JAFFAR_COMMON__INLINE__ void | initialize () |
| __JAFFAR_COMMON__INLINE__ void | finalize () |
| __JAFFAR_COMMON__INLINE__ void | run () |
| __JAFFAR_COMMON__INLINE__ void | setCurrentThread (Thread *const thread) |
| __JAFFAR_COMMON__INLINE__ Thread * | getCurrentThread () const |
| __JAFFAR_COMMON__INLINE__ void | yieldToRuntime () |
| __JAFFAR_COMMON__INLINE__ const std::set< threadId_t > & | getFinishedThreads () const |
Represents a simulated kernel-level thread runtime scheduler It uses user-level threads (coroutines) to carry their state and a Round Robin scheduling strategy to fairly distribute the CPU to them The newly created threads execute non-preemptively so the user needs to insert yields in the code to volunteerly give up execution
|
inline |
Creates a new thread and adds it to the thread queue
| [in] | fc | The function for the thread to execute |
|
inline |
Finalizes the runtime
|
inline |
Gets the current thread being scheduled
|
inline |
Gets the list of finished threads
|
inline |
Initializes the runtime
|
inline |
Starts running the scheduler. It won't return until all previously created threads have fully finished executing
|
inline |
Function to set the currently scheduled thread
| [in] | thread | The thread to set as current one |
|
inline |
A function for the thread to yield back to the runtime system