# How does Julia Async Task Scheduler work?

**URL:** <https://discourse.julialang.org/t/how-does-julia-async-task-scheduler-work/96675>\
**Category:** New to Julia\
**Tags:** question, async\
**Created:** [March 27, 2023, 8:11pm UTC](https://discourse.julialang.org/t/how-does-julia-async-task-scheduler-work/96675 "2023-03-27T20:11:24Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [March 27, 2023, 11:26pm UTC](https://discourse.julialang.org/t/how-does-julia-async-task-scheduler-work/96675/4 "2023-03-27T23:26:45Z")

</div>

It’s also worth noting that there are two different ways to spawn new tasks:

1. `@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;
2. `@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/how-does-julia-async-task-scheduler-work/96675)._
