透過您的圖書館登入
IP:18.119.29.162
  • 學位論文

同步最佳化核心架構

SyncFree: An Efficient Kernel Framework for Lock-Optimized Synchronization

指導教授 : 金仲達

摘要


同步化在平行程式中佔了很大部分,尤其對於效率的影響更為明顯,而同步大多是為了保守方式地保護程式正確性,例如互斥鎖,狀態變數等,都會強制讓程式序列執行各個臨界區間,而這些臨界區間通常會並不需要彼此間互斥,但是撰寫程式者為了正確起見,會宣告一些可能不需要互斥的臨界區間,甚至是大範圍的臨界區間,因而造成效率上大大的減低。 對於這個問題的研究,過去有許多方法提出來,例如交易記憶體。而交易記憶體又分為硬體實做以及軟體實做方式,而這兩種方式各有優缺點,硬體實做部分的缺點包含成本高,彈性低,而軟體實做方式提供一個介面給使用者,但是底層也是傳統的互斥鎖,所有使用者也必須瞭解交易記憶體如何使用,進而修改撰寫程式的方法或習慣,因此對於臨界區間所造成的效率瓶頸並沒有直接的提升。另一方法則是所謂的改進鎖方式來提升臨界區間的效率,過去這些也都只有出現在硬體上面的實做,而缺點也如同上述,成本高彈性低,因此我們提出一個既具有低成本且富有彈性,容易移植等特性的方法 – 同步自由(SyncFree),而此方法實做於作業系統核心之中,且具有使用者透明化特性,程式撰寫者也不需要重新改寫程式或學習新程式寫法,在最後的實驗中可以看出我們的方法對於平行化程式的執行效率有明顯提升。

關鍵字

同步

並列摘要


Synchronization is undoubtedly the critical and yet annoying part of parallel programming [3{5,13], especially in the performance aspect. As programmers and parallel compilers cannot statically determine whether a code block is race-free or not, synchronization primitives, such as mutex locks, barriers, and conditional variables, are applied onservatively to guarantee the correctness of parallel programs. The performance drop is then incurred because of unnecessary serialization of threads. In addition, a coarse-grained lock is often used in a shared data structure to protect all members in it. Although this kind of programming style is intuitive and easy to follow, threads are serialized unnecessarily when they updates di®erent members. In this paper, we propose SyncFree, an e±cient kernel framework or practical lock-optimized synchronization. SyncFree allows the speculative execution on conventional processors with a revised OS kernel and slightly modi?ed user libraries.

並列關鍵字

synchronization multicore

參考文獻


and Runtime Support for E±cient Software Transactional Memory. In Proceedings
of the 2006 ACM SIGPLAN Conference on Programming Language Design and Im-
Performance Computer Architecture, pages 316{327, February 2005.
in Erlang. Prentice Hall, 1996.
[5] L. Dagum and R. Menon. OpenMP: an Industry Standard API for Shared-Memory

延伸閱讀


國際替代計量