jQuery in Action, 3rd edition
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Can applets create threads? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Can applets create threads?" Watch "Can applets create threads?" New topic

Can applets create threads?

Eduard Manas
Ranch Hand

Joined: May 12, 2002
Posts: 69
This is a question from a mock exam:
A malicious applet has been developed to slow a machine down by calculating square roots of huge numbers (thus using plenty of CPU) and by creating a new thread every few seconds. Will this applet work or should the Java security manager stop it? (assuming a strict java security policy)

Surprise surprise the correct answer is the applet will work!
Whereas I knew the security.policy file cannot limit the CPU resources the applet uses, I would have thought that it can limit thread creation. I am pretty sure the security.policy can avoid an applet creating processes, but not that sure about threads.
Any suggestions?
Ricardo Polero Baraldi

Joined: Nov 14, 2002
Posts: 26
Yes, the applets can create a threads !
Rufus BugleWeed
Ranch Hand

Joined: Feb 22, 2002
Posts: 1551
This is thought to be an annoyance as opposed to a serious security problem. If you closed your applet viewer the problem goes away. On the otherhand the ability to run animations, downloads, calculations and keep a UI going at the same time is a nice feature.
I agree. Here's the link: http://aspose.com/file-tools
subject: Can applets create threads?
It's not a secret anymore!