#include <UT_Thread.h>
Definition at line 58 of file UT_Thread.h.
Enumerator |
---|
ThreadSingleRun |
|
ThreadLowUsage |
|
Definition at line 82 of file UT_Thread.h.
Enumerator |
---|
ThreadIdle |
|
ThreadRunning |
|
Definition at line 71 of file UT_Thread.h.
virtual UT_Thread::~UT_Thread |
( |
| ) |
|
|
virtual |
UT_Thread::UT_Thread |
( |
SpinMode |
spin_mode, |
|
|
bool |
uses_tbb |
|
) |
| |
|
protected |
static int UT_Thread::activeThreadCount |
( |
| ) |
|
|
static |
This is only valid in debug builds.
static UT_Thread* UT_Thread::allocThread |
( |
SpinMode |
spin_mode, |
|
|
bool |
uses_tbb = true |
|
) |
| |
|
static |
Allocate a new thread
- Parameters
-
spin_mode | Use ThreadSingleRun to have it exit when the thread callback is finished. Otherwise, ThreadLowUsage will cause the thread to loop back and wait for more startThread() calls to run different thread callbacks in the same thread. |
uses_tbb | Leave at true unless you absolutely know that no TBB tasks will be spawned in thread callbacks. |
static void UT_Thread::configureMaxThreads |
( |
int |
maxthreads = 0 | ) |
|
|
static |
Configure the global number of tasks used by the system
- The default value of 0 uses the number of logical cores on the system
- A negative value wraps it from the number of logical cores. eg. -1 will use all cores except for 1.
- If the negative value exceeds the number of logical cores, it is clamped to a value of 1.
- Note
- Only call this in the main thread when there are no tasks active.
-
This function is NOT thread-safe.
static void UT_Thread::configureThreadStackSize |
( |
int |
stacksize | ) |
|
|
static |
Configure the default stack size for threads
- A value of 0 uses the stack size of the main thread
- A value larger than 0 will use that specific stack size
- Note
- Only call this in the main thread when there are no tasks active.
-
This function is NOT thread-safe.
static int UT_Thread::getMainSequentialThreadId |
( |
| ) |
|
|
static |
static ut_thread_id_t UT_Thread::getMainThreadId |
( |
| ) |
|
|
static |
virtual int64 UT_Thread::getMemoryUsage |
( |
bool |
inclusive | ) |
const |
|
pure virtual |
NOTE: This level doesn't own any data apart from itself.
Implemented in UT_NullThread.
static int UT_Thread::getMySequentialThreadIndex |
( |
| ) |
|
|
inlinestatic |
static ut_thread_id_t UT_Thread::getMyThreadId |
( |
| ) |
|
|
static |
static int UT_Thread::getNumProcessors |
( |
| ) |
|
|
static |
virtual SpinMode UT_Thread::getSpinMode |
( |
| ) |
|
|
virtual |
virtual State UT_Thread::getState |
( |
| ) |
|
|
virtual |
int UT_Thread::isActive |
( |
| ) |
|
|
inline |
static int UT_Thread::isMainThread |
( |
| ) |
|
|
inlinestatic |
static bool UT_Thread::isMaxThreadsConfigured |
( |
| ) |
|
|
static |
virtual int UT_Thread::isResourceHog |
( |
| ) |
const |
|
virtual |
static bool UT_Thread::isThreadingEnabled |
( |
| ) |
|
|
static |
Returns true iff the current thread is allowed to create more tasks. This is sometimes disabled, to avoid needing to create a UT_TaskArena for small cases that won't get much benefit from threading. This should be checked by anything using tbb::parallel_for, tbb::parallel_invoke, or anything else creating TBB tasks.
static bool UT_Thread::isUTThreadCurrent |
( |
| ) |
|
|
static |
Returns true if the current thread is a UT_Thread. Returns false if the current thread is either the main thread or a TBB thread.
virtual int UT_Thread::isValid |
( |
| ) |
|
|
protectedvirtual |
void UT_Thread::killIdle |
( |
| ) |
|
|
protected |
virtual void UT_Thread::killThread |
( |
| ) |
|
|
pure virtual |
static bool UT_Thread::minimizeThisThreadPriority |
( |
| ) |
|
|
static |
Sets the current thread to minimum priority according to the rules of the platform. This function fails if called on a thread that is not a running UT_Thread. Returns true if the operation was successful, otherwise returns false.
static void UT_Thread::pause |
( |
uint |
cycles | ) |
|
|
inlinestatic |
static void UT_Thread::resetNumProcessors |
( |
| ) |
|
|
static |
Reset the number of threads that is used by Houdini. This will reread the HOUDINI_MAXTHREADS setting.
- Note
- There should be no active tasks when this is called.
-
Only call this from the MAIN THREAD!
virtual int UT_Thread::restartThread |
( |
| ) |
|
|
pure virtual |
virtual void UT_Thread::setState |
( |
State |
state | ) |
|
|
protectedpure virtual |
static bool UT_Thread::setThreadingEnabled |
( |
bool |
will_be_enabled | ) |
|
|
static |
This is used to disable (false) threading for the current thread, to avoid needing to create a UT_TaskArena for small cases that won't get much benefit from threading. It returns if it was enabled before. It is also used to re-enable (true) threading for the current thread.
virtual int UT_Thread::suspendThread |
( |
| ) |
|
|
pure virtual |
virtual void UT_Thread::threadEnded |
( |
| ) |
|
|
virtual |
virtual void UT_Thread::threadStarted |
( |
| ) |
|
|
virtual |
static void* UT_Thread::threadWrapper |
( |
void * |
data | ) |
|
|
staticprotected |
virtual void UT_Thread::waitForState |
( |
State |
desired | ) |
|
|
pure virtual |
virtual int UT_Thread::waitThread |
( |
int |
block = 1 | ) |
|
|
protectedpure virtual |
static void UT_Thread::yield |
( |
bool |
higher_only = false | ) |
|
|
static |
void* UT_Thread::myCBData |
|
protected |
volatile State UT_Thread::myState |
|
protected |
bool UT_Thread::myUsesTBB |
|
protected |
The documentation for this class was generated from the following file: