# Is Base.MPFR.setprecision in Julia 1.3 Thread Safe?

**URL:** https://discourse.julialang.org/t/is-base-mpfr-setprecision-in-julia-1-3-thread-safe/30394
**Category:** General Usage
**Created:** [October 28, 2019, 6:36am UTC](https://discourse.julialang.org/t/is-base-mpfr-setprecision-in-julia-1-3-thread-safe/30394 "2019-10-28T06:36:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)
#### Post date: [October 28, 2019, 6:36am UTC](https://discourse.julialang.org/t/is-base-mpfr-setprecision-in-julia-1-3-thread-safe/30394/1 "2019-10-28T06:36:57Z")

</div>

Is Base.MPFR.setprecision in Julia 1.3 Thread Safe?

 ![25%20PM](https://global.discourse-cdn.com/julialang/original/3X/9/9/99c9e98f864d4197bb26cf953f06d41c619d8dc6.png)

---

<div class="post-metadata">

### Author: ![foobar\_lv2](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)
#### Post date: [October 28, 2019, 8:20am UTC](https://discourse.julialang.org/t/is-base-mpfr-setprecision-in-julia-1-3-thread-safe/30394/2 "2019-10-28T08:20:51Z")

</div>

No.

```julia
julia> Base.MPFR.DEFAULT_PRECISION
Base.RefValue{Int64}(256)
julia> @noinline f() = a = rand(rand(50_000));
julia> Threads.@threads for i=1:23 setprecision(f, BigFloat, 23) end
julia> Threads.@threads for i=1:23 setprecision(f, BigFloat, 23) end
julia> Threads.@threads for i=1:23 setprecision(f, BigFloat, 23) end
julia> Base.MPFR.DEFAULT_PRECISION
Base.RefValue{Int64}(23)

```
