title: How and When to Use @async and @sync in Julia
body: <p>I have read the <a href="https://julia-doc.readthedocs.io/en/latest/manual/parallel-computing/" rel="noreferrer">documentation</a> for the <code>@async</code> and <code>@sync</code> macros but still cannot figure out how and when to use them, nor can I find many resources or examples for them elsewhere on the internet.  </p>
  
  <p>My immediate goal is to find a way to set several workers to do work in parallel and then wait until they have all finished to proceed in my code.  This post: <a href="https://stackoverflow.com/questions/32143159/waiting-for-a-task-to-be-completed-on-remote-processor-in-julia/32148849#32148849">Waiting for a task to be completed on remote processor in Julia</a> contains one successful way to accomplish this.  I had thought it should be possible using the <code>@async</code> and <code>@sync</code> macros, but my initial failures to accomplish this made me wonder if I am understanding properly how and when to use these macros.  </p>