开发者

Java Applet CPU restrictions?

Is there some type of cap as to how much CPU an applet 开发者_StackOverflowcan use? Or will my code run just as fast as a standard java program?


Applets generally runs with less privilege than standard applications, but there should be no CPU cap. There have been reports of applets crashing browsers by overusing CPUs, and rather than classifying them as security flaws that need dealing with, they're simply labeled as nuisances.

That said, applets run in a variety of environment, sometimes with little consistency (that's why they're problematic, and why Java Web Start is the recommended alternative). It could very well be the case that certain applet environments impose CPU limits on applets, etc.


The problem is that applets typically run as Threads in a JVM embedded in the browser. While you can adjust the priority of a Java thread, there is no way to place CPU caps on them. Indeed, I don't think you can even set CPU caps with the OS'es native threads. In the case of UNIX and UNIX-like operating systems, CPU usage limits and other limits are implemented on a per process basis.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜