On 15/03/2013 6:53 PM, Andrew Haley wrote:
On 03/15/2013 02:02 AM, David Holmes wrote:
Going OT somewhat ...

On 15/03/2013 2:47 AM, Jeroen Frijters wrote:
Andrew Haley wrote:
Good lord.  Unsafe is probably going to disappear from view when
modularization happens, so people had better get used to its absence.

I desperately hope so, but it is probably not realistic given how many high 
profile frameworks use it.

Unsafe will never go from OpenJDK6, 7 or 8. In a modular world the
relevant API's will need to be promoted to full supported status.

Fully supported?  How?  Unsafe interacts with the VM in somewhat
unpredictable ways by doing things underneath its feet.  In order for
this API to be supported we'd have to define what it actually does in
terms of the JMM.

A lot of the "unsafe" API's are quite predictable if used in the intended way - they are afterall used by the core libraries themselves (atomic ops and volatile ops as key examples). Obviously anything actually "unsafe" must be exposed only in a safe manner or else not exposed (like the direct memory pokes). In some cases that may negate the performance benefits that direct use of Unsafe has. These are the challenges to be addressed.

David
-----

  I guess we could simply say that all of the, er,
interesting cases are UB, in which case supporting it becomes easy.

Andrew.

Reply via email to