[concurrency-interest] RFC -- Java7 java.util.concurrent plans

Roman Elizarov elizarov at devexperts.com
Wed Dec 10 13:28:05 EST 2008


Hello, Doug!

> Concrete plans for Java7 release finally appear to be starting, and
> we've been asked which JSR166 follow-ons should be slated for
> inclusion. Here is the tentative list. Comments appreciated.

We badly need a fast way to work with AtomicIntegerArray and
AtomicReferenceArray. It does not neccessary need any API changes. One
approach is to have JVM team make sure that a call get(i) is as fast
as array access and enjoys all the same optimizations during
translation to machine code. Other approaches involve API changes. One
of the following API changes will suffice:
* Provide a method to "wrap" existing array without copying it.
* Provide a method to get an underlying array.
* Provide AtomicXXXArrayUpdater class.

Otherwise, all high-performance code (like Cliff Click's
high-scale-lib and the kind of code we are writing to process millions
of quotes per second) is forced to use sun.misc.Unsafe which is a kind
of ugly last-resort approach.

Also, we had recently stumbled into an absence of "compareAndPoll"
method on ConcurrentLinkedQueue (you "peek", then you try to do
something with the object and only if you successfull you do
"compareAndPoll"). A minor issue, though, and might not deserve an API
change.

Sincerely,
Roman Elizarov




More information about the Concurrency-interest mailing list