ThreadHarmonizer API
Documentation
Reference documentation for the multithreaded component base class and the shared runtime manager.
MonoBehaviourMultithreaded
The component base class for scripts that use ThreadHarmonizer’s recurring multithreading workflow.
namespace ThreadHarmonizerEngine
{
public abstract class MonoBehaviourMultithreaded : MonoBehaviour
{
}
}
Use it selectively
Only scripts that require ThreadHarmonizer’s recurring parallel execution need to inherit from this class.
Unity rules still apply
Worker functions should calculate with Unity-independent data. Unity object access must remain on the main thread.
Member functions
AddFunctionInstance
Registers a function for recurring execution on the shared worker pool.
DisableMultithreadingInstance
Temporarily disables multithreaded execution for this component.
EnableMultithreadingInstance
Re-enables multithreaded execution for this component.
EnqueueOnMainThreadHand-off
Queues the final Unity-side operation without blocking the calling worker thread.
EnqueueOnWorkerOne-time
Queues a one-time, Unity-independent operation on the shared worker pool.
GetFromMainThreadBlocking
Runs a function on Unity’s main thread and blocks the current background thread until it completes.
RemoveFunctionInstance
Removes a previously registered function from the recurring parallel update loop.
ResetMultithreadingInstance
Resets the ThreadHarmonizer multithreading state for this component.
ThreadHarmonizerManager
Static hand-off methods for scripts that need the shared worker pool without inheriting from MonoBehaviourMultithreaded.
using ThreadHarmonizerEngine;
Created automatically
Auto-create Manager is enabled by default and reuses an existing valid manager when one is already available.
Persistent singleton
The active runtime manager remains available across ordinary scene transitions.
Static member functions
EnqueueOnMainThreadStatic
Queues the Unity-side apply operation without blocking the calling worker thread.
EnqueueOnWorkerStatic
Queues a one-time, Unity-independent operation on the shared worker pool.
GetFromMainThreadBlocking
Runs a function on Unity’s main thread and blocks the current background thread until it completes.
