- Prefer the java.util.concurrent packages to either low-level wait-notify, custom locking/synchronization, or higher level scala-specific primitives. The util.concurrent stuff is well thought out and actually works correctly. There is a generally feeling that threads and locking are not going to be the concurrency primitives of the future because of a variety of well-known weaknesses they have. This is probably true, but they have the advantage of actually being mature enough to use for high-performance software right now; their well-known deficiencies are easily worked around by equally well known best-practices. So avoid actors, software transactional memory, tuple spaces, or anything else not written by Doug Lea and used by at least a million other productions systems. :-)
本文推荐使用java.util.concurrent包中的工具进行并发编程,而非传统的等待-通知机制或自定义锁同步。利用这些成熟且经过验证的工具可以有效地避免并发编程中常见的陷阱,并确保高性能软件的正确实现。
650

被折叠的 条评论
为什么被折叠?



