# Questions about asych calls and threads

**URL:** <https://forum.inductiveautomation.com/t/questions-about-asych-calls-and-threads/97633>\
**Category:** Ignition\
**Tags:** perspective, vision, scripting\
**Created:** [October 22, 2024, 7:27pm UTC](https://forum.inductiveautomation.com/t/questions-about-asych-calls-and-threads/97633 "2024-10-22T19:27:42Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 29, 2025, 10:25pm UTC](https://forum.inductiveautomation.com/t/questions-about-asych-calls-and-threads/97633/10 "2025-01-29T22:25:21Z")

</div>

I would only support such a `threadPool()` if it tied itself to the lifetime of the scripting environment, killing off pending tasks on scripting restart, refusing new tasks at that point, and killing any running tasks within a few seconds. It is otherwise extremely unsafe (memory leaking) if given tasks with long durations, scheduled more than a few seconds in the future, or anything repeating.

I strongly encourage construction of queues holding native jython or java objects **instead of code**. More details here (read the whole topic):

> [@Java concurrent queue for tag change scripts](https://forum.inductiveautomation.com/t/java-concurrent-queue-for-tag-change-scripts/82044):
>
> Continuing the discussion from [[SOLVED] Are tag Value Changed scripts running asynchronously?](https://forum.inductiveautomation.com/t/solved-are-tag-value-changed-scripts-running-asynchronously/68704/5): We've got code in our standard library that I need to log a value change on a tag and then associate various data points with that value change. The value is located in a UDT, and because this is part of our "standard" library we use for our customers, the number of tags is variable and quite possibly numerous so having a gateway tag event script isn't feasible for this solution. I was reading up on …

---

_[View the full topic](https://forum.inductiveautomation.com/t/questions-about-asych-calls-and-threads/97633)._
