multithreading - 为什么javafx应用程序不是线程安全的?

标签 multithreading thread-safety javafx javafx-2 javafx-8

我对 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/

相关文章:

c++ - posix 中的内核线程

java - 如果线程修改的变量被标记为 volatile,为什么 false 共享是一个问题

linux - POSIX 线程是如何在 Linux 上实现的?

Python 队列 get()/task_done() 问题

java - SimpleThreads 示例中的 threadMessage 是否应该同步?

c# - 在多线程服务中监听的更好方法是什么?

c# - 当我使用线程将内容打印到控制台时,为什么会产生奇怪的结果?

css - 如何将css转换为bss

java - 不可移动的警报窗口

java - JavaFX 2.2 : how to bind String to Integer?