我对 javafx 中的线程概念感到困惑。
那么请帮助我为什么 javafx 应用程序不是线程安全的?
这背后的原因是什么?
最佳答案
来自Concurrency in JavaFX docs :
The JavaFX scene graph, which represents the graphical user interface of a JavaFX application, is not thread-safe and can only be accessed and modified from the UI thread also known as the JavaFX Application thread. Implementing long-running tasks on the JavaFX Application thread inevitably makes an application UI unresponsive. A best practice is to do these tasks on one or more background threads and let the JavaFX Application thread process user events.
关于multithreading - 为什么javafx应用程序不是线程安全的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22004450/