Unsafe: removing the monitorEnter/monitorExit/tryMonitorEnter methods
John Rose
john.r.rose at oracle.com
Thu Mar 13 19:21:46 UTC 2014
On Mar 13, 2014, at 4:21 AM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
> On Mar 12, 2014, at 10:23 PM, John Rose <john.r.rose at oracle.com> wrote:
>> P.S. FTR, I wish we could also remove the per-object monitor from its privileged position, so not all objects are burdened by it, and other forms of lock can be switched into the existing notation on a type-by-type basis. This is obviously a long, long term wish. A starting point is a notion of "this object has no monitor".
>
> Like an instance of a value type?
Yes, and also a *boxed* instance of value type, yes. Like String or Integer, if I had my wish (incompatible change only for unreasonable code). Like the unenforced "value-based classes" of JDK 8, notably Optional. And frozen objects (JEP 169).
http://download.java.net/jdk8/docs/api/java/lang/doc-files/ValueBased.html
http://openjdk.java.net/jeps/169
— John
> Paul.
>
>> Probably the keyword cannot be repurposed but would eventually be deprecated. And the Moon will reach Roche limit.
>>
>> – John
>>
>>> On Mar 12, 2014, at 2:12 PM, John Rose <john.r.rose at oracle.com> wrote:
>>>
>>> I think that we've covered all the angles, and that we can remove it.
>>>
>>> – John
>>>
>>>> On Mar 12, 2014, at 1:44 PM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
>>>>
>>>>
>>>> Currently i cannot find any external uses of it.
>
More information about the core-libs-dev
mailing list