# Prevent Task from yielding

**URL:** <https://discourse.julialang.org/t/prevent-task-from-yielding/27263>\
**Category:** General Usage\
**Created:** [August 7, 2019, 12:01pm UTC](https://discourse.julialang.org/t/prevent-task-from-yielding/27263 "2019-08-07T12:01:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackf](https://avatars.discourse-cdn.com/v4/letter/j/b4bc9f/32.png) [@jackf](https://discourse.julialang.org/u/jackf)\
**Post date:** [August 7, 2019, 12:01pm UTC](https://discourse.julialang.org/t/prevent-task-from-yielding/27263/1 "2019-08-07T12:01:16Z")

</div>

I was thinking this morning about the new 1.3 Task system. Is there any way to _prevent_ a particular task from yielding, even if it is doing operations that would usually yield e.g. i/o, sleeping etc?

---

<div class="post-metadata">

**Author:** ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Post date:** [August 8, 2019, 12:01am UTC](https://discourse.julialang.org/t/prevent-task-from-yielding/27263/2 "2019-08-08T00:01:04Z")

</div>

I’m going to say NO. The only reason you would want to do this, is to do something you shouldn’t. i.e. you should be using Mutexs to protect critical code rather than keeping a task running to prevent anything else from executing the critical code.

Unless you are thinking about a different reason you don’t want anything else scheduled?
