# Should I use multiple threads for parallel GC with otherwise sequential code?

**URL:** <https://discourse.julialang.org/t/should-i-use-multiple-threads-for-parallel-gc-with-otherwise-sequential-code/109719>\
**Category:** General Usage\
**Tags:** parallel, gc\
**Created:** [February 5, 2024, 12:40am UTC](https://discourse.julialang.org/t/should-i-use-multiple-threads-for-parallel-gc-with-otherwise-sequential-code/109719 "2024-02-05T00:40:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [February 5, 2024, 12:40am UTC](https://discourse.julialang.org/t/should-i-use-multiple-threads-for-parallel-gc-with-otherwise-sequential-code/109719/1 "2024-02-05T00:40:00Z")

</div>

As Julia v10 has added parallel GC, is it advisable to use multiple threads with the `-t` command line option of `julia` even if the code to be run is non-parallel? Is there any possible performance regression compared with single-threaded GC?

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [February 5, 2024, 12:51am UTC](https://discourse.julialang.org/t/should-i-use-multiple-threads-for-parallel-gc-with-otherwise-sequential-code/109719/2 "2024-02-05T00:51:10Z")

</div>

In general multithreaded GC will often speed up single threaded programs, although in 1.10 there are a few places ([place work-stealing queue indices on different cache lines to avoid false-sharing by d-netto · Pull Request #52994 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/52994)) where multithreaded GC causes regressions that will be fixed in 1.10.1
