default
core
corecore.ThreadallocEventQueue(int size) - Allocate mailbox event queue/ring buffer.
create(Function entryFunction) : boolean -
Delay() - Put thread to sleep for a short time (low CPU load).
getId() : int - Return thread id (platform-specific).
GetMaxAffinityMask32() : int - Pseudo-static method. Queries maximum supported affinity mask ( (1<<numProcessors)-1 ).
getName() : String - Query thread name (debug)
GetNumCPUCores() : int - Query number of logical CPU cores
getPriority() : int - Query thread priority
getUserData() : Object - Get thread user data
IsAffinityMaskStringBitSet(int bit) : boolean - Pseudo-static method. Test if the given bit is set in the affinity string mask.
IsCPUCoreShared(int coreIdx) : boolean -
IsCPUCoreShared(int coreIdx) : boolean -
IsPerformanceCPUCore(int coreIdx) : boolean -
isRunning() : boolean - Query whether thread is currently running
kill() - Terminate thread
peekEvent() : Event - Return next pending event without removing it from the queue.
peekEventById(int id) : Event - Return next pending event whose id matches "id" without removing it from the queue.
rand() : int - Generate random number (thread-safe)
sendEvent(Event ev) - Post new message in mailbox.
setAffinityMask32(int mask) - Set thread affinity mask.
setAffinityMaskByString(String mask) - Set thread affinity mask.
setCPUCore(int coreIdx) - Assign thread to specified CPU core.
setName(String name) - Set thread name (debug)
setPriority(int prio) - Set thread priority
SetProcessAffinityMask32(int mask) : boolean - Set process affinity mask (Windows only).
SetProcessAffinityMaskByString(String mask) : boolean - Set process affinity mask (Windows only).
SetProcessPriorityClass(int priorityClass) - Set process priority class (Windows only).
setUserData(Object o) - Set thread user data
srand(int seed) - Set random seed (thread-safe)
SwitchToThread() - Schedule next waiting thread.
wait() : int - Wait for thread
waitEvent(int timeoutMS) : Event - Return next pending event or wait for new event to arrive.
waitEventById(int id, timeoutMS) : Event - Return next pending event whose id matches "id" or wait for new matching event to arrive.
Yield() - Schedule next waiting thread (same as SwitchToThread())int PROCESS_PRIORITY_CLASS_HIGH -
int PROCESS_PRIORITY_CLASS_IDLE -
int PROCESS_PRIORITY_CLASS_NORMAL -
int PROCESS_PRIORITY_CLASS_REALTIME -
int THREAD_PRIORITY_ABOVE_NORMAL -
int THREAD_PRIORITY_BELOW_NORMAL -
int THREAD_PRIORITY_HIGHEST -
int THREAD_PRIORITY_IDLE -
int THREAD_PRIORITY_LOWEST -
int THREAD_PRIORITY_NORMAL -
int THREAD_PRIORITY_TIME_CRITICAL -
A thread may run on a different processor (if available).
Each thread has a mailbox that can be used to receive messages from other threads.
Method allocEventQueue | |||||
Allocate mailbox event queue/ring buffer. | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method create | ||||||||||
Signature | ||||||||||
| ||||||||||
Arguments | ||||||||||
| ||||||||||
Returns | ||||||||||
| ||||||||||
Method Delay | |||
Put thread to sleep for a short time (low CPU load). | |||
Signature | |||
|
Method getId | |||||
Return thread id (platform-specific). | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method GetMaxAffinityMask32 | |||||
Pseudo-static method. Queries maximum supported affinity mask ( (1<<numProcessors)-1 ). | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method GetNumCPUCores | |||||
Query number of logical CPU cores | |||||
Signature | |||||
| |||||
Returns | |||||
| |||||
Description | |||||
@ret number of logical CPU cores |
Method getPriority | |||||
Query thread priority | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getUserData | |||||
Get thread user data | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method IsAffinityMaskStringBitSet | ||||||||||
Pseudo-static method. Test if the given bit is set in the affinity string mask. | ||||||||||
Signature | ||||||||||
| ||||||||||
Arguments | ||||||||||
| ||||||||||
Returns | ||||||||||
| ||||||||||
Method IsCPUCoreShared | ||||||||||
Signature | ||||||||||
| ||||||||||
Arguments | ||||||||||
| ||||||||||
Returns | ||||||||||
| ||||||||||
Method IsCPUCoreShared | ||||||||||
Signature | ||||||||||
| ||||||||||
Arguments | ||||||||||
| ||||||||||
Returns | ||||||||||
| ||||||||||
Method IsPerformanceCPUCore | ||||||||||
Signature | ||||||||||
| ||||||||||
Arguments | ||||||||||
| ||||||||||
Returns | ||||||||||
| ||||||||||
Method isRunning | |||||
Query whether thread is currently running | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method kill | |||
Terminate thread | |||
Signature | |||
|
Method peekEvent | |||||
Return next pending event without removing it from the queue. | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method peekEventById | ||||||||||
Return next pending event whose id matches "id" without removing it from the queue. | ||||||||||
Signature | ||||||||||
| ||||||||||
Arguments | ||||||||||
| ||||||||||
Returns | ||||||||||
| ||||||||||
Method rand | |||||
Generate random number (thread-safe) | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method sendEvent | |||||
Post new message in mailbox. | |||||
Signature | |||||
| |||||
Arguments | |||||
| |||||
Description | |||||
This will clone the given Event object and unlink any deletable userdata object from "ev". |
Method setAffinityMask32 | |||||
Set thread affinity mask. | |||||
Signature | |||||
| |||||
Arguments | |||||
| |||||
Description | |||||
Keep in mind that this call will fail on Windows if the mask contains bits for non-available processor cores.Please use GetMaxAffinityMask32() to query the maximum supported mask.
This method is not supported on macOS. |
Method setAffinityMaskByString | |||||
Set thread affinity mask. | |||||
Signature | |||||
| |||||
Arguments | |||||
| |||||
Description | |||||
The mask is currently limited to 64 logical processors (todo: support processor groups). Keep in mind that this call will fail on Windows if the mask contains bits for non-available processor cores.Please use GetMaxAffinityMask32() to query the maximum supported mask.
On macOS the mask should contain only a single set bit and the method will fall back to setCPUCore(). |
Method setCPUCore | |||||
Assign thread to specified CPU core. | |||||
Signature | |||||
| |||||
Arguments | |||||
| |||||
Description | |||||
Fall back to setAffinityMask32() when tks was not compiled with HAVE_WIN10 define. |
Method setPriority | |||||
Set thread priority | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method SetProcessAffinityMask32 | ||||||||||
Set process affinity mask (Windows only). | ||||||||||
Signature | ||||||||||
| ||||||||||
Arguments | ||||||||||
| ||||||||||
Returns | ||||||||||
| ||||||||||
Method SetProcessAffinityMaskByString | ||||||||||
Set process affinity mask (Windows only). | ||||||||||
Signature | ||||||||||
| ||||||||||
Arguments | ||||||||||
| ||||||||||
Returns | ||||||||||
| ||||||||||
Description | ||||||||||
The mask is currently limited to 64 logical processors (todo: support processor groups). This method is not supported on macOS. | ||||||||||
Method SetProcessPriorityClass | |||||
Set process priority class (Windows only). | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method setUserData | |||||
Set thread user data | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method srand | |||||
Set random seed (thread-safe) | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method SwitchToThread | |||
Schedule next waiting thread. | |||
Signature | |||
|
Method wait | |||||
Wait for thread | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method waitEvent | ||||||||||
Return next pending event or wait for new event to arrive. | ||||||||||
Signature | ||||||||||
| ||||||||||
Arguments | ||||||||||
| ||||||||||
Returns | ||||||||||
| ||||||||||
Description | ||||||||||
Please notice that this method returns null in case the wait() timed out or got interrupted. | ||||||||||
Method waitEventById | ||||||||||||||||||||
Return next pending event whose id matches "id" or wait for new matching event to arrive. | ||||||||||||||||||||
Signature | ||||||||||||||||||||
| ||||||||||||||||||||
Arguments | ||||||||||||||||||||
| ||||||||||||||||||||
Returns | ||||||||||||||||||||
| ||||||||||||||||||||
Description | ||||||||||||||||||||
Please notice that this method returns null in case the wait() timed out or got interrupted. | ||||||||||||||||||||
Method Yield | |||
Schedule next waiting thread (same as SwitchToThread()) | |||
Signature | |||
| |||
Description | |||
Can cause high CPU load when no other threads are waiting to be scheduled. |
Constant PROCESS_PRIORITY_CLASS_HIGH (int) | |
Constant PROCESS_PRIORITY_CLASS_IDLE (int) | |
Constant PROCESS_PRIORITY_CLASS_NORMAL (int) | |
Constant PROCESS_PRIORITY_CLASS_REALTIME (int) | |
Constant THREAD_PRIORITY_ABOVE_NORMAL (int) | |
Constant THREAD_PRIORITY_BELOW_NORMAL (int) | |
Constant THREAD_PRIORITY_HIGHEST (int) | |
Constant THREAD_PRIORITY_IDLE (int) | |
Constant THREAD_PRIORITY_LOWEST (int) | |
Constant THREAD_PRIORITY_NORMAL (int) | |
Constant THREAD_PRIORITY_TIME_CRITICAL (int) | |
auto-generated by "DOG", the TkScript document generator. Thu, 11/Dec/2025 13:41:59