这里是上一篇:[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.
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.