# How to create task firstly and start it not on the main thread?

**URL:** https://discourse.julialang.org/t/how-to-create-task-firstly-and-start-it-not-on-the-main-thread/108502
**Category:** General Usage
**Created:** [January 8, 2024, 9:28am UTC](https://discourse.julialang.org/t/how-to-create-task-firstly-and-start-it-not-on-the-main-thread/108502 "2024-01-08T09:28:51Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![SunnyUser](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sunnyuser/32/206001_2.png) [@SunnyUser](https://discourse.julialang.org/u/SunnyUser)
#### Post date: [January 8, 2024, 9:28am UTC](https://discourse.julialang.org/t/how-to-create-task-firstly-and-start-it-not-on-the-main-thread/108502/1 "2024-01-08T09:28:51Z")

</div>

Hi all 🙂

I want to seperate task creation and task start, but I want to use all available threads.

Thanks

---

<div class="post-metadata">

### Author: ![SunnyUser](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sunnyuser/32/206001_2.png) [@SunnyUser](https://discourse.julialang.org/u/SunnyUser)
#### Post date: [January 8, 2024, 9:33am UTC](https://discourse.julialang.org/t/how-to-create-task-firstly-and-start-it-not-on-the-main-thread/108502/2 "2024-01-08T09:33:39Z")

</div>

[https://docs.julialang.org/en/v1/base/parallel/#Core.Task](https://docs.julialang.org/en/v1/base/parallel/#Core.Task)

---

<div class="post-metadata">

### Author: ![SunnyUser](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sunnyuser/32/206001_2.png) [@SunnyUser](https://discourse.julialang.org/u/SunnyUser)
#### Post date: [January 8, 2024, 9:34am UTC](https://discourse.julialang.org/t/how-to-create-task-firstly-and-start-it-not-on-the-main-thread/108502/3 "2024-01-08T09:34:34Z")

</div>

There is my anwser.

> By default tasks will have the sticky bit set to true `t.sticky` . This models the historic default for `@async`. Sticky tasks can only be run on the worker thread they are first scheduled on. To obtain the behavior of `Threads.@spawn` set the sticky bit manually to `false` .
