|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
Thread creation, lifecycle control and per-thread CPU statistics. More...
Thread creation, lifecycle control and per-thread CPU statistics.
Classes | |
| struct | cmlabs::ThreadStats |
| Bookkeeping record for a single managed thread. More... | |
| struct | cmlabs::ThreadDataHeader |
| Header at the start of the ThreadManager's contiguous storage block. More... | |
| class | cmlabs::Runnable |
| Minimal cooperative-shutdown base class for objects that run a worker thread. More... | |
| class | cmlabs::ThreadManager |
| Singleton registry that creates, controls and profiles all CMSDK threads. More... | |
Macros | |
| #define | GETTHREADSTATS(data, id) |
| Compute the address of thread slot id inside storage block data. | |
Functions | |
| static THREAD_RET THREAD_FUNCTION_CALL | cmlabs::ThreadMonitoring (void *arg) |
| Entry function of the monitoring thread; delegates to ThreadManager::threadMonitoring(). | |
| #define GETTHREADSTATS | ( | data, | |
| id ) |
Compute the address of thread slot id inside storage block data.
Resolves the block layout header + bitfield + stats[] described in ThreadDataHeader. Must only be used while holding the manager mutex, since a concurrent resizeThreadStorage() may free the block.
Definition at line 190 of file ThreadManager.h.
Referenced by cmlabs::ThreadManager::addLocalThreadStats(), cmlabs::ThreadManager::continueThread(), cmlabs::ThreadManager::createThread(), cmlabs::ThreadManager::getAllThreadStats(), cmlabs::ThreadManager::getLocalThreadID(), cmlabs::ThreadManager::getThreadStats(), cmlabs::ThreadManager::interruptThread(), cmlabs::ThreadManager::isThreadRunning(), cmlabs::ThreadManager::pauseThread(), cmlabs::ThreadManager::resizeThreadStorage(), cmlabs::ThreadManager::shutdown(), cmlabs::ThreadManager::terminateThread(), and cmlabs::ThreadManager::threadMonitoring().
|
static |
Entry function of the monitoring thread; delegates to ThreadManager::threadMonitoring().
On POSIX (non-Darwin) it first unblocks SIGQUIT so the thread can be cancelled; on Windows no signal setup is needed.
Definition at line 528 of file ThreadManager.cpp.
References cmlabs::ThreadManager::Singleton, THREAD_FUNCTION_CALL, THREAD_RET, and thread_ret_val.
Referenced by cmlabs::ThreadManager::init().