JDK中可扩展性和线程安全的注意事项
• Manage a pool of threads
• Easily schedule tasks for concurrent execution
• Exchange data between concurrently running threads in a thread-safe manner
• Gain fine-grained synchronization
• Benefit from better concurrent performance using concurrent data structures
Although the newer API helps in a number of ways, it still requires us to be
vigilant to avoid race conditions and shared mutable data.