An enhanced thread synchronization mechanism for Java

Citation
Ht. Chiao et Sm. Yuan, An enhanced thread synchronization mechanism for Java, SOFTW PR EX, 31(7), 2001, pp. 667-695
Citations number
23
Categorie Soggetti
Computer Science & Engineering
Journal title
SOFTWARE-PRACTICE & EXPERIENCE
ISSN journal
00380644 → ACNP
Volume
31
Issue
7
Year of publication
2001
Pages
667 - 695
Database
ISI
SICI code
0038-0644(200106)31:7<667:AETSMF>2.0.ZU;2-9
Abstract
The thread synchronization mechanism of Java is derived from Hoare's monito r concept. In the authors' view, however, it is over simplified and suffers the following four drawbacks. First, it belongs to a category of no-priori ty monitor, the design of which, as reported in the literature on concurren t programming, is not well rated. Second, it offers only one condition queu e. Where more than one long-term synchronization event is required, this re striction both degrades performance and further complicates the ordering pr oblems that a no-priority monitor presents. Third, it lacks the support for building more elaborate scheduling programs. Fourth, during nested monitor invocations, deadlock may occur In this paper we first analyze these drawb acks in depth before proceeding to present our own proposal, which is a new monitor-based thread synchronization mechanism that we term EMonitor This mechanism is implemented solely by Java, thus avoiding the need for any mod ification to the underlying Java Virtual Machine. A preprocessor is employe d to translate the EMonitor syntax into the pure Java codes that invoke the EMonitor class libraries. We conclude with a comparison of the performance of the two monitors and allow the experimental results to demonstrate that , in most cases, replacing the Java version with the EMonitor version for d eveloping concurrent Java objects is perfectly feasible. Copyright (C) 2001 John Wiley & Sons, Ltd.