Reputation: 628
If I create a GUI on a different thread, and make sure that any updates that happen to the GUI occur on that thread and that thread only- is it then still thread safe? I know this would be difficult to ensure, so in a way I'm kind of asking: Is there anything special/different about the EDT compared to other threads?
Keep in mind I'm not asking about good practices or other solutions to this problem, I'm asking if, on a purely technical level, if you basically treated a thread like the EDT, would the GUI created on the new thread be safe to use?
Upvotes: 0
Views: 53
Reputation: 521
It is not thread safe because your processes are not the only one that read/write UI element. JRE is also read and write but it does it via EDT. So even if you read/write in the single thread which is not EDT there are processes that do it in EDT - so you end up with one UI element, few threads, no synchronization.
Upvotes: 1