On 17 Oct 2012, at 16:59, Jason Greene <jason.greene(a)redhat.com> wrote:
>> Not sure about the safety of the
computeIfAbsent/computeIfPresent approach, as I don't have any experience with it, but
doesn't CHMV8 use unsafe operations that prevent us from using in SecurityManager
scenarios?
>
> I'll have to check.
It does use Unsafe. This isn't really a security manager problem though because you
just need the permission to access a protected field, which we usually always need anyway.
The bigger problem is portability, although all known JDKs have these Unsafe classes,
because they all use the same concurrent impl code. That said, you can be 100% sure by
simply making a version that uses AtomicFieldUpdaterXXX, extending AtomicXXX, and using
other constructs and using that as the fall back version. That's what I do anyway :)
The current CHMv8 impl from jsr166e works fine under IBM's JDK. That's the only
one I know of that is not based on OpenJDK. I suppose maybe worthwhile testing on JRockit
too …
--
Manik Surtani
manik(a)jboss.org
twitter.com/maniksurtani
Platform Architect, JBoss Data Grid
http://red.ht/data-grid