简体   繁体   English

即将推出的 Java 并发库是什么:jsr166y? jsr166z?

[英]What's the upcoming Java concurrency library: jsr166y? jsr166z?

I wanted to play around with the upcoming concurrency library which is going to be included in我想尝试即将推出的并发库,它将包含在
Java 7 according to this website .根据本网站的Java 7。

It seems to be named JSR166 .它似乎被命名为JSR166

In most places its reference implementation is referred as jsr166y , while few resources call it jsr166z .在大多数地方,它的参考实现被称为jsr166y ,而很少有资源称它为jsr166z

I discovered two totally different javadocs for each reference implementation.我为每个参考实现发现了两个完全不同的javadoc。

Now, which implementation is going to be included in Java 7?现在,Java 7 中将包含哪个实现?

EDIT编辑
While people who answered suggest that jsr166y is the thing for Java 7, I discovered this document (TS-5515) from JavaOne.虽然回答的人建议 jsr166y 是 Java 7 的东西,但我从 JavaOne 发现了这个文档 (TS-5515) This document refers to Java 7 but mentions LinkedAsyncAction which is only present in jsr166z javadocs.本文档指的是 Java 7,但提到了 LinkedAsyncAction,它仅存在于 jsr166z javadocs 中。 (Confusion...) (困惑...)

JSR 166 was the original Java concurrency jsr for Java 5 that created java.util.concurrent. JSR 166 是 Java 5 的原始 Java 并发 jsr,它创建了 java.util.concurrent。 They did a maintenance rev in Java 6 called JSR 166x.他们在 Java 6 中做了一个名为 JSR 166x 的维护版本。 The Java 7 maintenance rev is JSR 166y. Java 7 维护版本是 JSR 166y。 JSR 166z is the closures prototype version. JSR 166z 是闭包原型版本。

Currently slated to be included in JSR 166y is:目前计划包含在 JSR 166y 中的是:

  • Fork/join (but NOT the ParallelArray framework) Fork/join(但不是 ParallelArray 框架)
  • TransferQueue / LinkedTransferQueue collection TransferQueue / LinkedTransferQueue 集合
  • Phasers (CyclicBarriers on steroids)移相器(类固醇的 CyclicBarriers)

Push to JDK 8 (at least):推送到 JDK 8(至少):

  • Fences API (low level), trying to remove use of Unsafe calls Fences API(低级),试图移除不安全调用的使用
  • ConcurrentReferenceHashMap (variable strong/weak refs, concurrent, etc) ConcurrentReferenceHashMap(变量强/弱引用、并发等)

For more info, javadoc here or join the concurrency-interest mailing list:有关更多信息,请点击此处的 javadoc或加入并发兴趣邮件列表:

The link on the javac.info site (jsr166z) uses BGGA closures which will not be in JDK7. javac.info 站点 (jsr166z) 上的链接使用了 JDK7 中没有的 BGGA 闭包。

The link on Doug Lea's site (jsr166y) should be up to date. Doug Lea 的站点 (jsr166y) 上的链接应该是最新的。 Doug is the spec lead.道格是规范负责人。 The API has been pruned down to the basics as how the fork-join framework will be used in practice is not yet clear.由于在实践中如何使用 fork-join 框架尚不清楚,因此 API 已被精简为基础。 Presumably libraries will be available at a slightly higher level, and when thing settle down more can be added to JDK8.据推测,库将在更高的级别上可用,当事情稳定下来时,可以将更多的库添加到 JDK8。

Looking at various references available (for example, this Email from Doug Lea), it seems clear that the current JSR for JDK7 concurrency additions is jsr166y.查看各种可用的参考资料(例如,来自 Doug Lea 的这封电子邮件),似乎很清楚当前用于 JDK7 并发添加的 JSR 是 jsr166y。 Additionally, if you go to the web page Closures for the Java Programming Language (aka BGGA) and look at (what is currently) the 4th bulleted item "Doug Lea's jsr166y fork-join framework", jsr166y is described as the fork-join framework "without function types" and jsr166z is described as the fork-join framework "with function types."此外,如果您访问Java 编程语言(又名 BGGA)的 Closures网页并查看(当前是什么)第 4 个项目符号“Doug Lea 的 jsr166y fork-join 框架”,则 jsr166y 被描述为 fork-join 框架“不带函数类型”,jsr166z 被描述为“带函数类型”的 fork-join 框架。

It looks like jsr166z is a cross between concurrency additions and BGGA.看起来 jsr166z 是并发添加和 BGGA 之间的交叉。 Perhaps this provides concurrency utilities required by BGGA?也许这提供了BGGA所需的并发实用程序?

Because it's not stable enough. 因为它不够稳定。

reply by Doug Lea: http://cs.oswego.edu/pipermail/concurrency-interest/2009-April/005964.html 道格·里(Doug Lea)的回复: http : //cs.oswego.edu/pipermail/concurrency-interest/2009-April/005964.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM