無鎖數據結構(五)

無鎖數據結構(五)

Andrei Alexandrescu

December 16, 2007

譯者:張桂權

12/25/2007


初稿階段,沒有得到許可不得引用,否則後果自負

7 結束語

無鎖數據結構是非常有希望的。它們通過線程消亡、優先級反演和信號安全等展示了很多優秀的特性。它們從來不會死鎖或活鎖。在測試中,最近的無鎖數據結構通過一個很大的容限超過了它們加鎖的副本。

然而,無鎖編程是一種技巧,尤其與內存分解有關。一個有垃圾收集的環境是必要的,因爲它擁有一些手段來終止和審查所有的線程,但是如果你想要確定性的解構,你需要硬件或內存分配器的特殊支持。泛型編程(Generic<Programming>)的下一部分將瞭解在執行確定性解構時支持無鎖的WRRMMap的優化方法。如果這一個部分中基於垃圾收集和WRRMBNTMmap不能滿足於你,那麼這兒有一個省錢的方法:不要去看電影,《Alien vs. Predator》,除非你喜歡“這麼壞,太滑稽了(so bad it’s funny)”的電影。

 

8 致謝

特別感謝Krzysztof Machelski,他審覈了代碼的實現,並提示其中的兩個bug

 

參考文獻

[1] Andrei Alexandrescu. Modern C++ Design.Addison-Wesley Longman, 2001.

[2] Andrei Alexandrescu. GenerichProgrammingi:yasli::vector is on the move. C++ Users Journal,June 2004.

[3] D.R. Butenhof. Programming with POSIX Threads. Addison-Wesley, Reading, Massachusetts,USA, 1997.

[4] David L. Detlefs, Paul A. Martin, Mark Moir,and Guy L. Steele, Jr. Lock-free reference counting.In Proceedings of the twentieth annual ACM symposium on Principles of distributed computing,pages 190199. ACM Press, 2001. ISBN 1-58113-383-9.

[5] Erich Gamma, Richard Helm, Ralph E. Johnson,and John Vlissides. Design Patterns. Addison-Wesley, Reading, MA, 1995.

[6] Scott Meyers and Andrei Alexandrescu. The Perils of Double-Checked Locking. Dr. Dobbs Journal,July 2004.

[7] Maged M. Michael. Scalable lock-free dynamic memory allocation.

In Proceedings of the ACM SIGPLAN 2004 conference on Programming language design and implementation,pages 3546.ACM Press, 2004. ISBN 1-58113-807-5.


---------------源文檔------------------
Lock-Free Data Structures
Andrei Alexandrescu
December 17, 2007
http://erdani.org/publications/cuj-2004-10.pdf
最後一次訪問時間:2007年12月30日
----------------------------------------

譯稿下載:
http://download.csdn.net/source/346893
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章