# Shared scripts - Thread safety

**URL:** <https://forum.inductiveautomation.com/t/shared-scripts-thread-safety/68130>\
**Category:** Ignition\
**Created:** [January 2, 2023, 7:03pm UTC](https://forum.inductiveautomation.com/t/shared-scripts-thread-safety/68130 "2023-01-02T19:03:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brian.ankeny](https://avatars.discourse-cdn.com/v4/letter/b/f04885/32.png) [@brian.ankeny](https://forum.inductiveautomation.com/u/brian.ankeny)\
**Post date:** [January 2, 2023, 7:03pm UTC](https://forum.inductiveautomation.com/t/shared-scripts-thread-safety/68130/1 "2023-01-02T19:03:10Z")

</div>

Are shared gateway scripts thread-safe (can a shared script be called from multiple udt tag events at the same time)?

---

<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 2, 2023, 11:34pm UTC](https://forum.inductiveautomation.com/t/shared-scripts-thread-safety/68130/2 "2023-01-02T23:34:16Z")

</div>

Yes and no.

The machinery is thread-safe. And core Jython types like lists and dictionaries are inherently thread-safe due to the use of `Concurrent*` java types in their implementations. But your algorithms you write may not be safe. Typical Python and Java expectations for the programmer apply.

But also note that events from the same source are executed sequentially by Ignition, which supplies some isolation for your algorithms.

TL/DR: It depends. (:
