# Using system.util.getGlobals with classes

**URL:** <https://forum.inductiveautomation.com/t/using-system-util-getglobals-with-classes/78760>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [September 5, 2023, 12:38pm UTC](https://forum.inductiveautomation.com/t/using-system-util-getglobals-with-classes/78760 "2023-09-05T12:38:51Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![Hayden\_Watson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hayden_watson/32/48792_2.png) [@Hayden\_Watson](https://forum.inductiveautomation.com/u/Hayden_Watson)\
**Post date:** [September 6, 2023, 1:32pm UTC](https://forum.inductiveautomation.com/t/using-system-util-getglobals-with-classes/78760/16 "2023-09-06T13:32:11Z")

</div>

So the thread I had found before was this:

> [@How to trigger a gateway timer to trigger immediately but no more than four times per minute?](https://forum.inductiveautomation.com/t/how-to-trigger-a-gateway-timer-to-trigger-immediately-but-no-more-than-four-times-per-minute/75476/2):
>
> The tag system is fully multithreaded and only locks what it needs, not what some queuing algorithm needs. You will suffer trying to do this with a memory dataset tag. Use a proper java concurrent queue. Set it up so that only a single copy is ever constructed (using system.util.getGlobals() and .setdefault()). Run a timer script that polls this queue, with a timeout the same as the fastest pace you want to run. Only place python or java native data types in such a queue. (I usually use py…

Maybe this would only be relevant in a queue like fashion, where the order does really matter, as when I found this that was a what I was developing at the time.  
My worry is that because object will be appended to often and then read at any given time, it may have similiar constraints as a queue. But again, maybe this isn't actually a problem.

My other concern is that if these sub-tasks are rapidly appended to, say in a single `for` loop, and it's being called from another script on a different thread, how will it handle that. Would I `system.tag.writeBlocking` on each index of that `for` loop? Or if I write my changes right at the end of the loop, will another script fail to write to it as its sub-task 'doesn't exist' yet.

These probably only one in a million chance of happening, hence why I'm just seeing what others in a similiar situation do before I start implementing it. TBH, the tag option isn't a bad idea, probably easier to implement in some ways.

---

_[View the full topic](https://forum.inductiveautomation.com/t/using-system-util-getglobals-with-classes/78760)._
