# Preemptive Threading

**URL:** <https://forum.xojo.com/t/preemptive-threading/74665>\
**Category:** General\
**Created:** [February 28, 2023, 10:15am UTC](https://forum.xojo.com/t/preemptive-threading/74665 "2023-02-28T10:15:58Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Thomas\_Tempelmann](https://forum.xojo.com/user_avatar/forum.xojo.com/thomas_tempelmann/32/315_2.png) [@Thomas\_Tempelmann](https://forum.xojo.com/u/Thomas_Tempelmann)\
**Post date:** [February 28, 2023, 9:17pm UTC](https://forum.xojo.com/t/preemptive-threading/74665/8 "2023-02-28T21:17:46Z")

</div>

I’ve demonstrated the same in pure Xojo code a while ago, too:

[http://files.tempel.org/RB/Threading/](http://files.tempel.org/RB/Threading/)

and even earlier:

> [@Using Grand Central Dispatch (GCD) for preemptive threading](https://forum.xojo.com/t/using-grand-central-dispatch-gcd-for-preemptive-threading/22612):
>
> I need some non-blocking file operations in my app (“Find Any File”), so I played around a little with GCD. Turns out that with a few declares I can nicely run pre-emptive thread operations via GCD. Of course, there are a few things to consider: Stack overflow checking needs to turned off in the preemptive code (#pragma StackOverflowChecking false). Background tasks need to be disabled in the preemptive code (#pragma DisableBackgroundTasks). All preemptive code must run in global (static) me…

---

_[View the full topic](https://forum.xojo.com/t/preemptive-threading/74665)._
