agx::Thread is a representation of an OS specific implementation of a computational thread.
More...
#include <Thread.h>
agx::Thread is a representation of an OS specific implementation of a computational thread.
Threads can execute generic tasks (agx::Task) and jobs (agx::Job).
Definition at line 199 of file Thread.h.
◆ RandomGenerator
◆ ThreadIdTable
◆ ThreadStorageData
◆ ThreadStorageKey
◆ Thread() [1/2]
| agx::Thread::Thread |
( |
Index |
id | ) |
|
|
protected |
◆ Thread() [2/2]
| agx::Thread::Thread |
( |
const Thread & |
| ) |
|
|
protecteddelete |
◆ ~Thread()
| virtual agx::Thread::~Thread |
( |
| ) |
|
|
protectedvirtual |
◆ addTask()
| static void agx::Thread::addTask |
( |
Task * |
task | ) |
|
|
static |
◆ allocatePerThreadStorage()
Allocate a storage location that is unique for each thread.
This key will be usable from all threads.
◆ exportAllTimelines()
| static void agx::Thread::exportAllTimelines |
( |
| ) |
|
|
static |
◆ flushLogs()
| static void agx::Thread::flushLogs |
( |
| ) |
|
|
static |
◆ flushTimelineLogs()
| static void agx::Thread::flushTimelineLogs |
( |
| ) |
|
|
static |
◆ freePerThreadStorage()
Deallocate the storage location.
No thread can use 'key' after this method has been called.
◆ generateUuid()
Generates a unique universal identifier.
- Returns
- a Unique Universal identifier
◆ getCurrentThread()
| static Thread * agx::Thread::getCurrentThread |
( |
| ) |
|
|
static |
◆ getCurrentThreadDescription()
| static std::string agx::Thread::getCurrentThreadDescription |
( |
| ) |
|
|
static |
- Returns
- a string describing the current thread. The format is "os, agx" where 'os' is an OS specific identifier (typically a number) and 'agx' is the agx thread id, or null if this is not an agx thread
◆ getDefaultStorage()
◆ getEnableJobTimeline()
| static bool agx::Thread::getEnableJobTimeline |
( |
| ) |
|
|
static |
◆ getId()
| Index agx::Thread::getId |
( |
| ) |
const |
◆ getIndex()
| Index agx::Thread::getIndex |
( |
| ) |
const |
Get an index suitable for use when storing per-thread data in e.g.
a Vector. The returned index is the thread ID for regular AGX worker threads and a value larger than the largest thread ID for non-AGX threads that has called registerAsAgxThread.
The value returned may change when the number of AGX threads is changed, and when other threads are registered or unregistered as AGX threads. It is therefor not recommended to store this value for longer than a single time step.
◆ getMainThread()
| Thread * agx::Thread::getMainThread |
( |
| ) |
|
|
static |
◆ getOverheadTime()
| Real agx::Thread::getOverheadTime |
( |
| ) |
const |
- Returns
- The overhead time for the thread, including jobpool stalls and job administration.
Definition at line 675 of file Thread.h.
◆ getPromotedThreads()
◆ getRandomGenerator()
Return a reference to the mersienne twister used for generating random numbers.
This is local to the thread and can be used safely from the current thread
- Returns
- reference to a mt19937 random generator
Definition at line 670 of file Thread.h.
◆ getThread()
| Thread * agx::Thread::getThread |
( |
size_t |
id | ) |
|
|
static |
◆ initThreadSystem()
| static void agx::Thread::initThreadSystem |
( |
| ) |
|
|
static |
◆ isMainThread()
| bool agx::Thread::isMainThread |
( |
| ) |
|
|
static |
◆ isShuttingDown()
| static bool agx::Thread::isShuttingDown |
( |
| ) |
|
|
static |
◆ log()
| int agx::Thread::log |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
|
inlinestatic |
◆ makeCurrentThreadMainThread()
| static void agx::Thread::makeCurrentThreadMainThread |
( |
| ) |
|
|
static |
Register current thread as main thread.
NOTE: The old main thread will also think it is the main thread!
◆ popTimelineEntryStorage()
◆ readPerThreadStorage()
Read the thread-local value for the currently executing thread associated with the given key.
◆ registerAsAgxThread()
| static Thread * agx::Thread::registerAsAgxThread |
( |
| ) |
|
|
static |
Register the current thread as an AGX thread.
Necessary to execute agx::Task instances. This is normally handled automatically.
◆ reportSystemJob()
| void agx::Thread::reportSystemJob |
( |
UInt64 |
startTick, |
|
|
UInt64 |
endTick, |
|
|
const char * |
description, |
|
|
const char * |
extraDataTitle = nullptr, |
|
|
agx::Real64 |
extraData = 0.0 |
|
) |
| |
Add an entry to the job duration log.
Intended to be used when the system performs some lengthy operation without using the job system.
This will NOT copy the content of 'description' and 'datatitle', so don't pass pointers to anything that will be deallocated before the next disk writing.
Referenced by agxTerrain::ScopeReportSystemJob::~ScopeReportSystemJob().
◆ resetOverheadTime()
| void agx::Thread::resetOverheadTime |
( |
| ) |
|
Reset the thread overhead time.
◆ resetStartTick()
| static void agx::Thread::resetStartTick |
( |
| ) |
|
|
static |
◆ setEnableJobTimeline()
| static void agx::Thread::setEnableJobTimeline |
( |
bool |
flag | ) |
|
|
static |
Enable or disable job timeline statistics.
◆ shutdown()
| static void agx::Thread::shutdown |
( |
| ) |
|
|
static |
Shutdown the threading system.
After this no threads will be available.
◆ start()
| bool agx::Thread::start |
( |
| ) |
|
◆ stop()
| void agx::Thread::stop |
( |
| ) |
|
◆ unregisterAsAgxThread()
| static void agx::Thread::unregisterAsAgxThread |
( |
| ) |
|
|
static |
Remove agx attributes from current thread.
This is normally handled automatically.
◆ writePerThreadStorage()
Write to the thread-local location owned by the currently executing thread.
◆ immediateLogging
| bool agx::Thread::immediateLogging |
|
static |
The documentation for this class was generated from the following file: