> For the complete documentation index, see [llms.txt](https://docs.lmms.io/developer-guides/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lmms.io/developer-guides/core/threading-and-synchronization.md).

# Threading and synchronization

There are three kinds of threads relevant to audio processing.

* Audio engine main thread: This can be either a FIFO writer thread(class `AudioEngine::fifoWriter`)or an audio file renderer thread(class `ProjectRenderer`). They calls `AudioEngine::renderNextBuffer()` which renders audio.
* Audio engine worker threads: They runs rendering subtasks which are queued by the audio engine main thread.
* UI, MIDI, and other threads: They may change parameters or drive instruments.

Non-automated changes may result in race conditions if they aren't synchronized with the audio engine properly. To prevent it, `AudioEngine` provides those functions:

* `requestChangeInModel()`/`doneChangeInModel()`:&#x20;

`AudioEngine` handles the calls using `runChangesInModel()`
