且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Swing线程安全创建图像吗?

更新时间:2023-01-13 18:44:21

不是线程安全的"意味着您不能一次从多个线程访问同一事物.
只要您不跨线程共享对象,就可以在后台线程上运行该代码没有任何问题.

"Not thread-safe" means that you must not access the same thing from multiple threads at once.
There is nothing wrong with running that code on a background thread, as long as you don't share the objects across threads.

请注意,大多数(非UI)对象对于只读操作都是线程安全的.

Note that most (non-UI) objects are thread-safe for read-only operation.