|
jaffarCommon
|
Contains the classes for serializing threading-parallel applications. More...
#include "exceptions.hpp"#include "timing.hpp"#include <functional>#include <libco/libco.h>#include <memory>#include <queue>#include <set>
Go to the source code of this file.
Classes | |
| class | jaffarCommon::dethreader::Runtime |
| class | jaffarCommon::dethreader::Runtime::Thread |
Macros | |
| #define | __JAFFAR_COMMON_DETHREADER_STATE |
| #define | __JAFFAR_COMMON_DETHREADER_STACK_SIZE 4 * 1024 * 1024 |
Typedefs | |
| typedef std::function< void()> | jaffarCommon::dethreader::threadFc_t |
| typedef uint64_t | jaffarCommon::dethreader::threadId_t |
Functions | |
| __JAFFAR_COMMON__INLINE__ Runtime::Thread * | jaffarCommon::dethreader::getCurrentThread () |
| __JAFFAR_COMMON__INLINE__ threadId_t | jaffarCommon::dethreader::createThread (const threadFc_t fc) |
| __JAFFAR_COMMON__INLINE__ void | jaffarCommon::dethreader::yield () |
| __JAFFAR_COMMON__INLINE__ void | jaffarCommon::dethreader::sleep (const size_t sleepDuration) |
| __JAFFAR_COMMON__INLINE__ void | jaffarCommon::dethreader::join (const threadId_t threadId) |
Variables | |
| Runtime * | jaffarCommon::dethreader::__runtime |
Contains the classes for serializing threading-parallel applications.
| #define __JAFFAR_COMMON_DETHREADER_STACK_SIZE 4 * 1024 * 1024 |
Size of each thread's stack
| #define __JAFFAR_COMMON_DETHREADER_STATE |
This macro needs to be inserted in any .cpp file to define the singleton
| typedef std::function<void()> jaffarCommon::dethreader::threadFc_t |
This library accepts only argument-less labmbda functions. Any required parameters need to be passed by capture
| typedef uint64_t jaffarCommon::dethreader::threadId_t |
Identification type for a thread
| __JAFFAR_COMMON__INLINE__ threadId_t jaffarCommon::dethreader::createThread | ( | const threadFc_t | fc | ) |
Publicly available Creates a new thread and adds it to the thread queue
| [in] | fc | The function for the thread to execute |
| __JAFFAR_COMMON__INLINE__ Runtime::Thread * jaffarCommon::dethreader::getCurrentThread | ( | ) |
Gets the current thread being scheduled
| __JAFFAR_COMMON__INLINE__ void jaffarCommon::dethreader::join | ( | const threadId_t | threadId | ) |
Function to wait for a thread completion
| [in] | threadId | Identifier of the thread to wait for |
| __JAFFAR_COMMON__INLINE__ void jaffarCommon::dethreader::sleep | ( | const size_t | sleepDuration | ) |
Publicly available function to send the thread to sleep
| [in] | sleepDuration | The number of microseconds to sleep for |
| __JAFFAR_COMMON__INLINE__ void jaffarCommon::dethreader::yield | ( | ) |
Publicly avialable function to yield back to the runtime
|
extern |
Singleton pointer to the running runtime