JDK 对线程组类注释:
A thread group represents a set of threads. In addition, a thread group can also include other thread groups. The thread groups form a tree in which every thread group except the initial thread group has a parent.
A thread is allowed to access information about its own thread group, but not to access information about its thread group's parent thread group or any other thread groups.
可以把线程归属到某一个线程组中,线程组中可以有线程对象,也可以有线程组,组中还可以有线程,这样的组织结构有点类似于树的形式,如图所示.
线程组的作用是:可以批量管理线程或线程组对象,有效地对线程或线程组对象进行组织
1.线程组示例:
展示线程组结构代码实例如下:
/**
* 类功能描述:
*
* @author WangXueXing create at 18-12-27 下午3:25
* @version