# How to use multithreading so each synth voice renders on a different CPU thread/core?

**URL:** <https://forum.juce.com/t/how-to-use-multithreading-so-each-synth-voice-renders-on-a-different-cpu-thread-core/45664>\
**Category:** General JUCE discussion\
**Created:** [April 23, 2021, 5:07am UTC](https://forum.juce.com/t/how-to-use-multithreading-so-each-synth-voice-renders-on-a-different-cpu-thread-core/45664 "2021-04-23T05:07:18Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![nicolasdanet](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/nicolasdanet/32/56_2.png) [@nicolasdanet](https://forum.juce.com/u/nicolasdanet)\
**Post date:** [April 23, 2021, 9:45am UTC](https://forum.juce.com/t/how-to-use-multithreading-so-each-synth-voice-renders-on-a-different-cpu-thread-core/45664/10 "2021-04-23T09:45:51Z")

</div>

FYI: there is interesting threads about that in this forum (search for “thread affinity”).

For instance:

> [@Multicore Support](https://forum.juce.com/t/multicore-support/6869):
>
> Hi Jules, your AudioProcessorGraph is really a great tool. Looking at some 20-50 or more plugins being hosted, I wonder if it would make sense to distribute the render work of a graph across multiple CPU cores. As it is implemented now, the entire chain of render ops is executed on a single thread. For a big graph with many plugins, this could get tight, i.e. the whole chain might not complete within the render block time slice. In theory, the graph could be splitted into parallel chains, eac…

> [@ThreadPool thread affinities](https://forum.juce.com/t/threadpool-thread-affinities/26187):
>
> It looks like ThreadPool just spawns a bunch of threads to be used for running jobs. Couldn’t this be made more (possibly much more) performant by setting the affinity for each thread such that the threads are locked to cores? This helps with situations where the OS/some other app wants to run something on one core, so the OS boots one of the ThreadPool threads off to another core, which then runs (or something else runs) and boots another ThreadPool thread off to another core, and so on, causi…

---

_[View the full topic](https://forum.juce.com/t/how-to-use-multithreading-so-each-synth-voice-renders-on-a-different-cpu-thread-core/45664)._
