简体   繁体   English

有没有示例显示JVM参数UnsyncloadClass的工作方式?

[英]Is there any example to show how does the JVM parameter UnsyncloadClass work?

I am new to Java, I learned that there is a setting for JVM "UnsyncloadClass", I googled it here 我是Java的新手,我了解到JVM有一个“ UnsyncloadClass”设置,我在这里用Google搜索了它

http://stas-blogspot.blogspot.com/2011/07/most-complete-list-of-xx-options-for.html http://stas-blogspot.blogspot.com/2011/07/most-complete-list-of-xx-options-for.html

"UnsyncloadClass    Unstable: VM calls loadClass unsynchronized. Custom classloader must call VM synchronized for findClass & defineClass   false   bool"

So I am not sure what does this mean, is there any code to illustrate how it works? 所以我不确定这是什么意思,是否有任何代码可以说明其工作原理? BTW, is this stable in Java7 or Java8 ? 顺便说一句,这在Java7或Java8中稳定吗? From literal meaning, I thought this might enable the JVM load classes in an async way, am I right? 从字面上看,我认为这可能会以异步方式启用JVM加载类,对吗? It will be great if any code illustrated how it works. 如果有任何代码说明其工作原理,那就太好了。

When this option is ON, loadClass method does acquire a ClassLoader lock, no matter if this ClassLoader is registered as parallel capable or not. 当此选项为ON时,无论此ClassLoader是否注册为支持并行功能loadClass方法均会获取ClassLoader锁定。

This option is never going to be "stable" nor recommended for production, since its behavior obviously violates the ClassLoader API specification . 因为该选项的行为显然违反了ClassLoader API规范 ,所以该选项永远不会“稳定”或推荐用于生产。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM