java applet:哪些线程调用生命周期挂钩?
我最近在小程序代码中遇到了一些非常奇怪的竞争条件。看起来 init() 和 start() 方法在 2 之前的 java 插件版本中已被不同的线程调用。你觉得怎么样,这可能吗?
所有 init/start/stop/destroy 钩子的 Java 插件版本 2 显示这些钩子是在 plugin2.applet.Plugin2Manager$AppletExecutionRunnable 上运行的。如果需要,可根据要求提供代码/日志。
UPD #1:我当前的版本是 java 6 update 24,linux。我的配置没有发现任何问题(所有钩子都从同一个线程运行),但也许有一些较旧的 1.5+ 版本的 Sun Java 插件的做法不同(最好是 Windows,但任何操作系统都可以) )。
UPD #2:至于“pre-2 java 插件版本” - 请参阅链接。 Java 版本 1.5 和 1.6 中的 Java 插件进行了重写。
谢谢, 安东
I've recently had some quite strange race condition in the applet code. Looks like init() and start() methods have been called by different threads in pre-2 java plugin version. What do you think, is this possible?
Java plugin version 2 for all of init/start/stop/destroy hooks shows that those hooks are run off plugin2.applet.Plugin2Manager$AppletExecutionRunnable. Code/logs available on request, if needed.
UPD #1: My current version is java 6 update 24, linux. I've seen no problems with my config (all hooks are run from the same thread), but maybe there're some older, 1.5+, versions of Sun's Java Plugins which do this differently (windows, preferrably, but any OS would do).
UPD #2: As for the "pre-2 java plugin version" - see the links. There was a rewrite of Java plugin across Java releases 1.5 and 1.6.
- Ken Russell Discusses The Rewritten Browser Java Plug-In
- Sun’s Promise: Reliable, Portable, Functional Java Plug-In
Thanks,
Anton
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在某些操作系统上运行某些 JRE 的某些浏览器的某些版本中,小程序可以实现任何操作。
In some versions of some browsers running some JREs on some OS', anything is possible with applets.