Java线程编程学习笔记(二)

这里是上一篇:[url=http://metaphy.iteye.com/blog/364187]Java线程编程学习笔记(一)[/url]

Java线程编程学习笔记(二)

26. Threads can also use thread-specific variables that keep a different value for different threads by using the classes ThreadLocal and InheritableThreadLocal.

27. The Swing Toolkit isn't multithread-safe!

28. Usually, we'll set frame visible in main() by
frame.setVisible(true);
After this method is invoked by main, it's no longer safe for any thread other than the event thread to make changes to the components.

29. In Java, all threads belong to an instance of the ThreadGroup class. A thread group has a name and some properties associated with it and can be used to facilitate the management of threads within it as a group. Thread groups allow the threads of the VM to be organized and can provide some inter-group security. A threadGroup can contain other ThreadGroups.

30.Thread pooling saves the virtual machine the work of creating brand new threads for every short-lived task. In addition, it minimizes overhead associated with getting a thread started and cleaning it up after it dies. By creating a pool of threads, a single thread from the pool can be recycled over and over for different tasks.


P.S
The attachment is the codes of the samples in this book.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值