摘要: We can’t avoid dealing with state, but we have three options:• Shared mutability• Isolated mutability• Pure immutabilityThough we’re used to shared mutability, we should avoid it as much aspossible. Eliminating shared mutable state is the easiest way to avoid synchronizationwoes. It takes us far mor 阅读全文
posted @ 2012-02-21 11:21 Colin_Ye 阅读(220) 评论(0) 推荐(0) 编辑
摘要: Here are the ways to reap the benefits of multicore processors:• We have to divide the application into multiple tasks that can be runconcurrently.• We should choose at least as many threads as the number of cores,provided the problem is large enough to benefit from those many threads.• For computat 阅读全文
posted @ 2012-02-21 11:09 Colin_Ye 阅读(213) 评论(0) 推荐(0) 编辑