# Getting different result from serial and multithreaded code in Julia

**URL:** <https://discourse.julialang.org/t/getting-different-result-from-serial-and-multithreaded-code-in-julia/93257>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [January 20, 2023, 10:36am UTC](https://discourse.julialang.org/t/getting-different-result-from-serial-and-multithreaded-code-in-julia/93257 "2023-01-20T10:36:44Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![skleinbo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skleinbo/32/36080_2.png) [@skleinbo](https://discourse.julialang.org/u/skleinbo)\
**Post date:** [January 23, 2023, 12:47pm UTC](https://discourse.julialang.org/t/getting-different-result-from-serial-and-multithreaded-code-in-julia/93257/22 "2023-01-23T12:47:42Z")

</div>

See these discussion

- [Multithreading, preallocation of objects, threadid() and task migration](https://discourse.julialang.org/t/multithreading-preallocation-of-objects-threadid-and-task-migration/67640)
- [Thread safe buffer correctness](https://discourse.julialang.org/t/thread-safe-buffer-correctness/60183)
- [Pattern for managing thread local storage?](https://discourse.julialang.org/t/pattern-for-managing-thread-local-storage/54023)

One solution appears to be using `FLoops.jl` [FAQ · FLoops](https://juliafolds.github.io/FLoops.jl/dev/explanation/faq/#faq-state-threadid)

---

_[View the full topic](https://discourse.julialang.org/t/getting-different-result-from-serial-and-multithreaded-code-in-julia/93257)._
