Tuesday, 28 April 2009

The Recursive Mechanics of java.lang.ThreadGroup

A ThreadGroup is a set of threads. Containment - a ThreadGroup can contain other ThreadGroups (which will be like "subtrees" of the original ThreadGroup). Threads within a group can share properties e.g. setMaxPriority will set max priority in group (method is called recursively, for every ThreadGroup in the ThreadGroup). A thread may only access information about its ThreadGroup.

ThreadGroup has a final checkAccess method to determine if the currently running Thread has permission to modify the ThreadGroup. If not, a SecurityException is thrown.

No comments: