# Multithreading strategy for audio plugins

**URL:** <https://forum.juce.com/t/multithreading-strategy-for-audio-plugins/59201>\
**Category:** Audio Plugins\
**Created:** [December 17, 2023, 1:34pm UTC](https://forum.juce.com/t/multithreading-strategy-for-audio-plugins/59201 "2023-12-17T13:34:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![StefanS](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@StefanS](https://forum.juce.com/u/StefanS)\
**Post date:** [December 17, 2023, 1:34pm UTC](https://forum.juce.com/t/multithreading-strategy-for-audio-plugins/59201/1 "2023-12-17T13:34:17Z")

</div>

Dear JUCE community,

I’ve written some dsp modules for audio visualisers (loudness metering, true peak, analyser, …). Some of them are also allocating data (!!) and I am sending data via InterprocessConnection to other clients over network.  
Basically I’m only reading the audio buffers from the plugin’s audio processor but not modifying them. That’s why I want to reduce the work on the audio thread to a minimum (only copy the audio buffer to a lock free FIFO) and doing the rest on a separate thread.

I’m wondering what’s the best strategy for it.

- Should I start one thread and run all modules on that thread or should I start a separate thread for every dsp module?
- should every plugin instance start it’s own thread(s) or should I start a static TimeSliceThread for all plugin instances?
- is there any special considerations for the different platforms (macOS, Windows), formats (AAX, VST, AU) and DAWs?

Thanks,  
Stefan
