# FFTW Plans for multiple threads

**URL:** https://discourse.julialang.org/t/fftw-plans-for-multiple-threads/21861
**Category:** Julia at Scale
**Tags:** fftw, multithreading
**Created:** [March 14, 2019, 12:19pm UTC](https://discourse.julialang.org/t/fftw-plans-for-multiple-threads/21861 "2019-03-14T12:19:33Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [March 14, 2019, 1:13pm UTC](https://discourse.julialang.org/t/fftw-plans-for-multiple-threads/21861/3 "2019-03-14T13:13:49Z")

</div>

The `irfft` call internally creates a plan and thus is also not thread safe. You can just create one forward and one inverse plan and share them between threads.

(On a separate note, for performance I would recommend preallocating the output array (per thread) and executing the plan in-place with `mul!`.)

---

_[View the full topic](https://discourse.julialang.org/t/fftw-plans-for-multiple-threads/21861)._
