# \`GC.gc\` thread-safety?

**URL:** <https://discourse.julialang.org/t/gc-gc-thread-safety/86823>\
**Category:** General Usage\
**Created:** [September 5, 2022, 9:46pm UTC](https://discourse.julialang.org/t/gc-gc-thread-safety/86823 "2022-09-05T21:46:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [September 5, 2022, 9:46pm UTC](https://discourse.julialang.org/t/gc-gc-thread-safety/86823/1 "2022-09-05T21:46:48Z")

</div>

Is calling `GC.gc()` concurrently from multiple threads allowed? How about `GC.gc(false)`?

I know the GC is stop-the-world, so doing that would diminish parallelism, I just want to know whether it’s correct to do so.

---

<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:** [September 5, 2022, 9:58pm UTC](https://discourse.julialang.org/t/gc-gc-thread-safety/86823/2 "2022-09-05T21:58:16Z")

</div>

This will be threadsafe. Running GC already stops all other threads, so it has the necessary barriers already.
