You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "raboof (via GitHub)" <gi...@apache.org> on 2023/06/19 14:11:07 UTC

[GitHub] [incubator-pekko] raboof opened a new issue, #417: Avoid usage of `sun.misc.Unsafe`

raboof opened a new issue, #417:
URL: https://github.com/apache/incubator-pekko/issues/417

   We currently still use `sun.misc.Unsafe` in a number of places. As long-term these interfaces are supposed to go away, it would be nice to try and stop using them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko] pjfanning commented on issue #417: Avoid usage of `sun.misc.Unsafe`

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on issue #417:
URL: https://github.com/apache/incubator-pekko/issues/417#issuecomment-1597297787

   The bright side is that lots of code is still using this class. Even the Scala runtime - eg https://github.com/scala/scala/blob/2.13.x/src/library/scala/runtime/Statics.java
   
   I'm no expert on migrating away from using `sun.misc.Unsafe` but `MethodHandle`s and `VarHandle`s might be an easy enough solution for some of the use cases.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko] He-Pin commented on issue #417: Avoid usage of `sun.misc.Unsafe`

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on issue #417:
URL: https://github.com/apache/incubator-pekko/issues/417#issuecomment-1732823650

   refs: https://youtrack.jetbrains.com/issue/IDEA-164460/JDK9-Multi-release-JAR-problem-one-type-shown-many-times


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [I] Avoid usage of `sun.misc.Unsafe` [pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on issue #417:
URL: https://github.com/apache/pekko/issues/417#issuecomment-3217981298

   done for 2.0.0 (main branch)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [I] Avoid usage of `sun.misc.Unsafe` [pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning closed issue #417: Avoid usage of `sun.misc.Unsafe`
URL: https://github.com/apache/pekko/issues/417


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko] SirYwell commented on issue #417: Avoid usage of `sun.misc.Unsafe`

Posted by "SirYwell (via GitHub)" <gi...@apache.org>.
SirYwell commented on issue #417:
URL: https://github.com/apache/incubator-pekko/issues/417#issuecomment-1682335651

   `VarHandle` could replace the usage of `Unsafe` pretty much 1:1. However, `VarHandle` is Java 9+.
   
   Looking at the usages, I'm wondering if much of it can be replaced by using `AtomicReference` instead. For example, consider https://github.com/apache/incubator-pekko/blob/3775a18c2eec1abd46355b656109f282d4115b40/actor/src/main/scala/org/apache/pekko/actor/RepointableActorRef.scala#L62-L80:
   
   To me, the tailrec methods look like overly complicated `getAndSet(...)` implementations, and `underlying` and `lookup` are just `get()`s.
   `Unsafe#getAndSetObject` was only added in Java 8, so I assume that's the reason it isn't used, but I'm not sure why the code doesn't make use of `AtomicReference`. Am I missing something?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko] He-Pin commented on issue #417: Avoid usage of `sun.misc.Unsafe`

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on issue #417:
URL: https://github.com/apache/incubator-pekko/issues/417#issuecomment-1597401720

   Some library start to using *Handler from    
    Jvm 11


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko] pjfanning commented on issue #417: Avoid usage of `sun.misc.Unsafe`

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on issue #417:
URL: https://github.com/apache/incubator-pekko/issues/417#issuecomment-1682603372

   There is a lot of reluctance to drop Java 8 support. I would favour dropping it because it forces us to support some code usages that are now being discouraged.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org