commons-exec 线程安全吗?

发布于 2024-08-29 15:32:17 字数 35 浏览 2 评论 0原文

Apache Commons Exec 是线程安全库吗?

Is Apache Commons Exec a thread-safe library?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无法言说的痛 2024-09-05 15:32:17

除非 javadoc 或其他文档声明某些类是线程安全的,否则您应该假设任何库都不是线程安全的,并自行解决同步问题。这尤其适用于应用程序导致库类的实例被多个线程共享的情况。

此原则的例外是内部线程安全,它是库实现的基础。为此,您有权假设实现者已经解决了这些问题,因为如果没有解决,则库将不可靠。

Unless the javadoc or other documentation claims that certain classes are thread-safe, you should assume that any library is not thread-safe, and address the synchronization concerns yourself. This particularly applies to the case where your application causes instances of the library's classes to be shared by multiple threads.

The exception to this principle is internal thread-safety that is fundamental to the implementation of the library. For that, you are entitled to assume that these concerns have been addressed by the implementors, because if they haven't been the library will be unreliable.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文