標題: 改進Java的執行緒同步機制
Enhancing Thread Synchronization Mechanism of Java
作者: 吳志泓
Chi-Horng Wu
袁賢銘
Shyan-Ming Yuan
資訊科學與工程研究所
關鍵字: 同步機制;Java;synchronization;monitor;thread;concurrency;deadlock;race condition
公開日期: 1998
摘要: 目前已有許多種同步機制的方式發表於世,而且不同的平台不同的語言都有其適當的解決方法,但是在Java方面確沒一個比較適合的解決方案。Java本身就有提供一個同步機制,但是它並不能真正的做到完全同步,因為其所提供的機制功能太少,常常要花很多的功夫才能達到所要的目的,而且對於一個程式設計者,他必須考慮很多細節才有辦法開發出不會有deadlock不會有race condition的同步應用程式。雖然目前在Java上已有一些解決的方法可以讓程式設計者很方便的開發同步應用程式,但是其最大的缺點則是效率太差。Monitor是已經在同步機制上應用很久的技術,Java本身的同步機制也是利用一些這種概念,但是由於是個簡化的monitor,所以用起來很明顯的不足,無論在找錯誤或者維護程式方面,使用起來不方便。這篇論文將會先敘述Java在同步應用程式上缺點以及其他的目前的解決方案,並且將介紹如何用我們所開發的monitor在程式語言層次上改進Java的同步機制以及說明如何用所提供的函式庫與前置處理器來幫助程式設計者開發同步應用程式,最後將會與其他的解決方案做各方面的比較。
There are many synchronized mechanisms announced now, and different platforms or programming languages have their own suitable solutions. But there are no proper solutions for Java. Java has its own synchronized mechanism, but it is not truly concurrent, it supports a limited form of currency. A programmer must take care of many details when developing concurrent applications. Even there are some solutions are designed for Java, and also let a programmer can develop concurrent applications more conveniently, but the poor performance is the common problem. Monitor is a technique used in concurrency control for a long time, Java synchronization mechanism also take advantages of this concept a little, but is not enough. This paper will declare the disadvantage of other solutions and will also introduce an approach for enhancing this mechanism in programming level bye use of our monitors. We will provide a library and preprocessor that are helping for concurrency control. Finally, we will compare our solution with others in performance and the complexity of coding style.
URI: http://140.113.39.130/cdrfb3/record/nctu/#NT870394017
http://hdl.handle.net/11536/64155
顯示於類別:畢業論文