# How to exchange date between GUI and a background thread?

**URL:** <https://forum.inductiveautomation.com/t/how-to-exchange-date-between-gui-and-a-background-thread/48051>\
**Category:** Ignition\
**Created:** [June 22, 2021, 9:20am UTC](https://forum.inductiveautomation.com/t/how-to-exchange-date-between-gui-and-a-background-thread/48051 "2021-06-22T09:20:54Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [June 22, 2021, 1:11pm UTC](https://forum.inductiveautomation.com/t/how-to-exchange-date-between-gui-and-a-background-thread/48051/4 "2021-06-22T13:11:05Z")

</div>

> [@Jerald.Zhang](#):
>
> Is this a right way?

Client tags are a safe way to pass data between GUI (foreground) and an asynchronous thread (background). Directly accessing window objects and the components within them **is not safe**. You have to delegate to short functions in the foreground to make any changes and safely read values. This topic discusses the relevant techniques:

> [@Update GUI via Asynchronous thread](http://forum.inductiveautomation.com/t/update-gui-via-asynchronous-thread/9666):
>
> I’ve got a script I am experimenting with that can take a lot of time to execute, so I now use the system.util.invokeAsynchronous to run the script in a separate thread to keep the GUI from locking up. I am using the asynchronous thread to copy files from one place to another, and I would like to show the progress of the file copy with a progress bar. How would I go about this? I am importing a few python libraries to do this. import shutil def fileTransfer(): path = system.file.openFile() …

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-to-exchange-date-between-gui-and-a-background-thread/48051)._
