# Examples of when to use @async over @spawn?

**URL:** <https://discourse.julialang.org/t/examples-of-when-to-use-async-over-spawn/114631>\
**Category:** Performance\
**Tags:** question\
**Created:** [May 23, 2024, 3:36pm UTC](https://discourse.julialang.org/t/examples-of-when-to-use-async-over-spawn/114631 "2024-05-23T15:36:38Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jbytecode](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbytecode/32/17719_2.png) [@jbytecode](https://discourse.julialang.org/u/jbytecode)\
**Post date:** [May 23, 2024, 4:39pm UTC](https://discourse.julialang.org/t/examples-of-when-to-use-async-over-spawn/114631/3 "2024-05-23T16:39:15Z")

</div>

Perhaps, does it help?

> [@How does Julia Async Task Scheduler work?](https://discourse.julialang.org/t/how-does-julia-async-task-scheduler-work/96675/4):
>
> It’s also worth noting that there are two different ways to spawn new tasks: @async which will always run the task on the same hardware thread as the current task, and will only make progress when the current task blocks and yields back to the scheduler; @spawn which creates a task that can be run on any hardware thread, so it can make progress while the current task is still working if there are other threads available. You can synchronize both with @sync.

---

_[View the full topic](https://discourse.julialang.org/t/examples-of-when-to-use-async-over-spawn/114631)._
