# Printing output of SharedArray

**URL:** <https://discourse.julialang.org/t/printing-output-of-sharedarray/3008>\
**Category:** New to Julia\
**Created:** [April 2, 2017, 11:25am UTC](https://discourse.julialang.org/t/printing-output-of-sharedarray/3008 "2017-04-02T11:25:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![xiaoweiz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaoweiz/32/2049_2.png) [@xiaoweiz](https://discourse.julialang.org/u/xiaoweiz)\
**Post date:** [April 2, 2017, 12:50pm UTC](https://discourse.julialang.org/t/printing-output-of-sharedarray/3008/2 "2017-04-02T12:50:53Z")

</div>

I had a similar problem a couple of days ago ([Correct usage of SharedArray and @parallel?](https://discourse.julialang.org/t/correct-usage-of-sharedarray-and-parallel/2979)).

Basically, you need to add `@sync` in front of `@parallel` to force the available threads wait for the end of loop operations before doing something else.

---

_[View the full topic](https://discourse.julialang.org/t/printing-output-of-sharedarray/3008)._
