java - JAVA中的"threadsafe"修饰符?

标签 java thread-safety grammar bnf modifier

我刚刚遇到了一个BNF Grammar for JAVA 。其中,“修饰符”有一个称为“threadsafe”的终结符号。但是,我以前从未见过它,也无法在《Java 语言规范》Java SE 7 版 (docs.oracle.com/javase/specs/jls/se7/jls7.pdf) 中找到该修饰符。然而,我找到了here ,在第 16 条中将其描述为:

If another thread excuting this code at the same time can not change the value of a variable then the variable is threadsafe and the compiler may do clever things with it to make the code faster or smaller.

这是一个真正的修饰符吗?它应该在即将推出的 JAVA 版本中引入吗?

最佳答案

尝试找到它here ,位于 Java BNF 的官方来源。

关于java - JAVA中的"threadsafe"修饰符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10334612/

相关文章:

java - 更新页面以使用新命名空间 xmlns.jcp.org 后,JSF 标记未呈现

.Net4, Monitor.Enter(lockObject, acquiredLock)

variables - 如何处理 yacc/bison 中的变量引用(使用 ocaml)

java - 以下类中的对象是不可变的吗?

java - 尝试从过去的打印 Java 中读取控制台

Java Controller 和 Service - 在 Service 中实现 Getter 和 Setter

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

.net - Dictionary<K,V> 线程对于同时阅读和添加是否安全?

java - 采用 "not"但不采用 "not like"的词法分析器

python - 如何重载运算符 `in`?