# Do long-running Tasks have to yield?

**URL:** <https://forums.swift.org/t/do-long-running-tasks-have-to-yield/54734>\
**Category:** Using Swift\
**Tags:** concurrency\
**Created:** [January 20, 2022, 12:37am UTC](https://forums.swift.org/t/do-long-running-tasks-have-to-yield/54734 "2022-01-20T00:37:38Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Jon\_Shier](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jon_shier/32/921_2.png) [@Jon\_Shier](https://forums.swift.org/u/Jon_Shier)\
**Post date:** [January 20, 2022, 1:09am UTC](https://forums.swift.org/t/do-long-running-tasks-have-to-yield/54734/3 "2022-01-20T01:09:20Z")

</div>

> [@David\_Smith](#):
>
> > [@](#):
> >
> > 1. Might I be misinterpreting what I'm seeing and should look for another cause for the SPOD?
> 
> It's quite possible. In particular, I wouldn't expect the main actor/thread to be subject to this, since it's not a member of the pool that you're blocking. Similarly, I wouldn't expect the priority to matter here, since the main thread is automatically very high priority, so that's puzzling.

Might this be the [inappropriate actor stickiness](https://forums.swift.org/t/se-0338-clarify-the-execution-of-non-actor-isolated-async-functions/54621) in action, where the work hasn't properly detached from the main actor? Lowering the priority lets it work because the main actors native items are processed first?

@RonAvitzur If you can post an abstracted version of how and where you're enqueuing the work, perhaps we can see something.

---

_[View the full topic](https://forums.swift.org/t/do-long-running-tasks-have-to-yield/54734)._
