Thread groups were originally envisioned as a mechanism for isolating applets for security purposes. They never really fulfilled this promise, and their security importance has waned to the extent that they aren't even mentioned in the standard work on the Java security model [Gong03].

They allow you to apply certain Thread primitives to a bunch of threads at once. Several of these primitives have been deprecated, and the remainder are infrequently used.

The API that lists the subgroups of a thread group is similarly flawed. While these problems could have been fixed with the addition of new methods, they haven't, because there is no real need: thread groups are obsolete.

Summary

Thread groups don't provide much in the way of useful functionality, and much of the functionality they do provide is flawed. Thread groups are best viewed as an unsuccessful experiment, and you should simply ignore their existence. If you design a class that deals with logical groups of threads, you should probably use thread pool executors (Item 68).

Effective Java 73 Avoid thread groups的更多相关文章

  1. Effective Java 67 Avoid excessive synchronization

    Principle To avoid liveness and safety failures, never cede control to the client within a synchroni ...

  2. Effective Java 50 Avoid strings where other types are more appropriate

    Principle Strings are poor substitutes for other value types. Such as int, float or BigInteger. Stri ...

  3. Effective Java 70 Document thread safety

    Principle The presence of the synchronized modifier in a method declaration is an implementation det ...

  4. Effective Java 07 Avoid finallizers

    NOTE Never do anything time-critical in a finalizer. Never depend on a finalizer to update critical ...

  5. Effective Java 05 Avoid creating unnecessary objects

    String s = new String("stringette"); // Don't do this. This will create an object each tim ...

  6. Effective Java 48 Avoid float and double if exact answers are required

    Reason The float and double types are particularly ill-suited for monetary calculations because it i ...

  7. Effective Java 59 Avoid unnecessary use of checked exceptions

    The burden is justified if the exceptional condition cannot be prevented by proper use of the API an ...

  8. Effective Java Index

    Hi guys, I am happy to tell you that I am moving to the open source world. And Java is the 1st langu ...

  9. 《Effective Java》读书笔记 - 10.并发

    Chapter 10 Concurrency Item 66: Synchronize access to shared mutable data synchronized这个关键字不仅保证了同步,还 ...

随机推荐

  1. 开放产品开发(OPD):Archi 汉化工具下载

    本文更新版本已挪至  http://www.zhoujingen.cn/blog/3378.html ------------------------------ 在OPD中,我们使用了ArchiMa ...

  2. Mysql学习笔记(八)索引

    PS:把昨天的学习内容补上...发一下昨天学的东西....五月三日...继续学习数据库... 学习内容: 索引.... 索引的优点: 1.通过创建唯一索引,可以保证数据库每行数据的唯一性... 2.使 ...

  3. CentOS6.5菜鸟之旅:安装rpmforge软件库

    一.rpmforge软件库    rpmforge是包含4000多种CentOS软件的软件库,被CentOS社区认为是安全和稳定的软件库. 二.安装rpmforege       1. 在http:/ ...

  4. IOS开发UI基础storyboard相关概念的认识

    本文主要介绍一些基本的概念 为后面的学习做个准备 需要了解的知识点有以下几个方面: storyboard文件的认识 IBAction 和IBOutlet UIViewController控制器的认识 ...

  5. 黑客入门之IP地址及常用命令

    在网络上,只要利用IP地址就可以找到目标主机,因此,如果黑客想要攻击某个网络主机,就要先确定该目标主机的域名或IP地址. IP地址概述 所谓IP地址就是一种主机编址方式,给每个连接在Internet上 ...

  6. 从web页面启动winform程序的实现方法

    本文实现的需求是: A.通过web页面启动winform程序: B.将页面的参数传递给winform程序: C.winform程序已经启动并正在运行时,从web页面不能重新启动winform程序,只是 ...

  7. 重新想象 Windows 8.1 Store Apps (88) - 通信的新特性: 新的 HttpClient

    [源码下载] 重新想象 Windows 8.1 Store Apps (88) - 通信的新特性: 新的 HttpClient 作者:webabcd 介绍重新想象 Windows 8.1 Store ...

  8. Linux下centos系统安装redis和php-redis

    源地址:http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm  //此为centos 6版本 安装输入 ...

  9. eclipse中的web项目路径和发布好的项目路径

    现在企业开发中,我们都会创建一个javaWeb工程,在eclipse中指的是新建一个dynamic web project,创建完工程之后,我们在IDE中大体看到如下的工程目录: 我们主要关心的文件夹 ...

  10. 轻量级SaaS在线作图工具ProcessOn

    俗话说“一图胜千言”,在办公应用领域,流程图是一个非常好的表现企业业务流程或工作岗位规范等内容的展现形式,比如去给客户做调研,回来后都要描述出客户的关键业务流程,谁.什么时候.在什么地方.负责什么事情 ...