# 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:** 2

<div class="post-metadata">

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

</div>

`@async` and `@spawn` have the same cost. The difference is in the semantics and for new code there is no reason to use `@async`. We needed `@spawn` to not break existing code that depended on the precise semantics of `@async`

---

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