# Killing/Interrupting a Thread started by system.util.invokeAsynchronous

**URL:** <https://forum.inductiveautomation.com/t/killing-interrupting-a-thread-started-by-system-util-invokeasynchronous/76492>\
**Category:** Ignition\
**Tags:** ignition81, vision, scripting\
**Created:** [July 17, 2023, 10:30pm UTC](https://forum.inductiveautomation.com/t/killing-interrupting-a-thread-started-by-system-util-invokeasynchronous/76492 "2023-07-17T22:30:10Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 17, 2023, 11:00pm UTC](https://forum.inductiveautomation.com/t/killing-interrupting-a-thread-started-by-system-util-invokeasynchronous/76492/2 "2023-07-17T23:00:43Z")

</div>

The real answer here is that the thread should manage it's own lifecycle. You shouldn't kill threads.

> [@Ignition Memory increasing after Scripting Restart](https://forum.inductiveautomation.com/t/ignition-memory-increasing-after-scripting-restart/66799/11):
>
> It isn’t safe to kill threads. Threads can and should be designed to be interruptible (checking for interrupt status and/or exceptions for graceful exit). If you didn’t do that, interrupt() may not work. If not, you will have to restart the gateway. Start here: Some other search results: [https://forum.inductiveautomation.com/search?q=kill%20invokeAsynchronous](https://forum.inductiveautomation.com/search?q=kill%20invokeAsynchronous)[https://forum.inductiveautomation.com/search?q=persistent%20thread%20leak](https://forum.inductiveautomation.com/search?q=persistent%20thread%20leak)

---

_[View the full topic](https://forum.inductiveautomation.com/t/killing-interrupting-a-thread-started-by-system-util-invokeasynchronous/76492)._
