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

一笑奈何 提交于 2019-11-30 03:23:05

问题


I wanted to play around with the upcoming concurrency library which is going to be included in
Java 7 according to this website.

It seems to be named JSR166.

In most places its reference implementation is referred as jsr166y, while few resources call it jsr166z.

I discovered two totally different javadocs for each reference implementation.

  • Docs for jsr166y
  • Docs for jsr166z

Now, which implementation is going to be included in Java 7?

EDIT
While people who answered suggest that jsr166y is the thing for Java 7, I discovered this document (TS-5515) from JavaOne. This document refers to Java 7 but mentions LinkedAsyncAction which is only present in jsr166z javadocs. (Confusion...)


回答1:


JSR 166 was the original Java concurrency jsr for Java 5 that created java.util.concurrent. They did a maintenance rev in Java 6 called JSR 166x. The Java 7 maintenance rev is JSR 166y. JSR 166z is the closures prototype version.

Currently slated to be included in JSR 166y is:

  • Fork/join (but NOT the ParallelArray framework)
  • TransferQueue / LinkedTransferQueue collection
  • Phasers (CyclicBarriers on steroids)

Push to JDK 8 (at least):

  • Fences API (low level), trying to remove use of Unsafe calls
  • ConcurrentReferenceHashMap (variable strong/weak refs, concurrent, etc)

For more info, javadoc here or join the concurrency-interest mailing list:

  • http://cs.oswego.edu/mailman/listinfo/concurrency-interest



回答2:


The link on the javac.info site (jsr166z) uses BGGA closures which will not be in JDK7.

The link on Doug Lea's site (jsr166y) should be up to date. 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. Presumably libraries will be available at a slightly higher level, and when thing settle down more can be added to JDK8.




回答3:


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. 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."

It looks like jsr166z is a cross between concurrency additions and BGGA. Perhaps this provides concurrency utilities required by BGGA?



来源:https://stackoverflow.com/questions/753956/whats-the-upcoming-java-concurrency-library-jsr166y-jsr166z

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!