-
Notifications
You must be signed in to change notification settings - Fork 1
background job
senso edited this page Jun 22, 2026
·
2 revisions
#example #threading #advanced
Asynchronous background task execution.
| Module Name | big task async process test |
| Type | mtSimple |
| Color | clInterfaceDesignModuleColor |
| Source | examples/BackgroundJob/ |
Demonstrates the SDK's background job system for executing heavy computations without blocking the audio thread. Shows the complete job lifecycle: begin, process, and end hooks.
| # | Name | Type | I/O | Range | Callback |
|---|---|---|---|---|---|
| 0 | data1 |
ptDataField |
Input | 0–1 | ctImmediate |
| 1 | data2 |
ptDataField |
Input | 0–1 | ctImmediate |
| 2 | start job |
ptButton |
Input | — | ctImmediate |
| 3 | processing |
ptRightLed |
Output (ReadOnly, DontSave) | — | None |
| 4 | out |
ptDataField |
Output (ReadOnly, DontSave) | — | None |
- User sets
data1anddata2input values - Clicking
start jobcallsstartJob()(SDK method) -
onJobBegin(background thread): Sets processing LED on -
onJobProcess(background thread): Runs heavy computation (100M iterations of nested sin calculations) -
onJobEnd(main thread): Sets processing LED off, outputs the result
User clicks "start job"
└── startJob()
├── onJobBegin() ← background thread: setup
├── onJobProcess() ← background thread: heavy work
└── onJobEnd() ← main thread: collect results
Important:
onJobBeginandonJobProcessrun on a background thread.onJobEndruns on the main thread, making it safe to update outputs and UI.
-
startJob()— launches the background job thread -
onJobBegin/onJobProcess/onJobEndlifecycle hooks -
DontProcess = TRUE— no audio processing needed -
CanBeRandomized = TRUE— randomize support -
ptRightLedas a processing indicator - Thread-safe result passing via class member variables
onGetModuleInfo · onInitModule · onGetParamInfo · onCallBack · onProcess · onJobBegin · onJobProcess · onJobEnd
- MultiThreading — Manual thread management
- RingModMultithread — Real-time multi-threading