# Setting number of threads after launch

**URL:** <https://discourse.julialang.org/t/setting-number-of-threads-after-launch/45792>\
**Category:** General Usage\
**Created:** [August 30, 2020, 2:48pm UTC](https://discourse.julialang.org/t/setting-number-of-threads-after-launch/45792 "2020-08-30T14:48:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gideonsimpson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gideonsimpson/32/1928_2.png) [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Post date:** [August 30, 2020, 2:48pm UTC](https://discourse.julialang.org/t/setting-number-of-threads-after-launch/45792/1 "2020-08-30T14:48:51Z")

</div>

When I use the `Distributed` module, I can add/remove the number of processes after launching Julia or within a Jupyter notebook. Is there any similar functionality with `Threads`, or must the thread count be set at launch?

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [August 30, 2020, 3:20pm UTC](https://discourse.julialang.org/t/setting-number-of-threads-after-launch/45792/2 "2020-08-30T15:20:16Z")

</div>

as far as I know it needs to be set at launch.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [August 30, 2020, 3:47pm UTC](https://discourse.julialang.org/t/setting-number-of-threads-after-launch/45792/3 "2020-08-30T15:47:36Z")

</div>

Control is to a certain degree available via `Base.Threads.@spawn`: when running Julia start maximum number of threads you wish to use (`julia -t n`), but then only use as many tasks as you wish.
