Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2491956.2462175acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

AutoSynch: an automatic-signal monitor based on predicate tagging

Published: 16 June 2013 Publication History

Abstract

Most programming languages use monitors with explicit signals for synchronization in shared-memory programs. Requiring programmers to signal threads explicitly results in many concurrency bugs due to missed notifications, or notifications on wrong condition variables. In this paper, we describe an implementation of an automatic signaling monitor in Java called AutoSynch that eliminates such concurrency bugs by removing the burden of signaling from the programmer. We show that the belief that automatic signaling monitors are prohibitively expensive is wrong. For most problems, programs based on AutoSynch are almost as fast as those based on explicit signaling. For some, AutoSynch is even faster than explicit signaling because it never uses signalAll, whereas the programmers end up using signalAll with the explicit signal mechanism.
AutoSynch} achieves efficiency in synchronization based on three novel ideas. We introduce an operation called closure that enables the predicate evaluation in every thread, thereby reducing context switches during the execution of the program. Secondly, AutoSynch avoids signalAll by using a property called relay invariance that guarantees that whenever possible there is always at least one thread whose condition is true which has been signaled. Finally, AutoSynch uses a technique called predicate tagging to efficiently determine a thread that should be signaled. To evaluate the efficiency of AutoSynch, we have implemented many different well-known synchronization problems such as the producers/consumers problem, the readers/writers problems, and the dining philosophers problem. The results show that AutoSynch is almost as efficient as the explicit-signal monitor and even more efficient for some cases.

References

[1]
G. R. Andrews. Multithreaded, Parallel, and Distributed Programming. Addison-Wesley, MA, 2000.
[2]
P. Brinch Hansen, The Programming language concurrent Pascal. IEEE Trans. Software Engineering, 1(2), 199--207, June, 1975.
[3]
P. Brinch Hansen, Structured multiprogramming. Commun. ACM 15(7), 574--578, July 1972.
[4]
P. A. Buhr, M. Fortier, and M. H. Coffin, Monitor Classification. ACM Computing Surveys, ACM, 27(1), 63--107, Mar. 1995.
[5]
P. A. Buhr and A. S. Harji, Implicit-signal monitors. ACM Transactions on Programming Languages and Systems ACM, 27(6):1270--1343, Nov. 2005.
[6]
D. R. Butenhof, Programming With Posix Threads. Addison-Wesley, MA, 1997.
[7]
P. J. Courtois, F. Heymans, D. L. Parnars, Concurrent control with "readers" and "writers". Commun. ACM, 14(10), 667--668, Oct. 1971.
[8]
E. W. Dijkstra, Cooperating Sequential Processes. Technical Report EWD-123, 1965.
[9]
E. W. Dijkstra, The structure of the "THE"-multiprogramming system.Commun. ACM, 11(5), 341--346, May 1968.
[10]
E. W. Dijkstra, Hierarchical Ordering of Sequential Processes. Acta Informatica, 1, 115--138, 1971.
[11]
J. Gosling, B. Joy, and G. Steele, The Java Language Specification. 2nd ed. Addison-Wesley, MA, 2000.
[12]
V. K. Garg and N. Mittal, A Critique of Java for Concurrent Programming, IEEE Distributed Systems online 6(9), 2005.
[13]
A. Hejisberg, S. Wiltamuth, and P. Golde, C# Language Specification. Addison-Wesley, MA, 2003.
[14]
C. A. R. Hoare, Monitors: an operating system structuring concept. Commun. ACM, 17(10), 549--557, Oct. 1974.
[15]
Y.-J. Joung, Asynchronous group mutual exclusion. ACM Symposium on Principles of Distributed Computing, 51--60, Aug. 1998.
[16]
J. L. W. Kessels. An alternative to event queues for synchronization in monitors. Commun. ACM, 20(7), 500--503, July 1977.
[17]
V. Kodaganallur, Incorporating language processing into Java applications: a JavaCC tutorial. IEEE Software, 21(4), 70--77, July-Aug. 2004.
[18]
D. Lea, The java.util.concurrent synchronizer framework. Science of Computer Programming, 58(3), 293--309, Dec. 2005.
[19]
B. Stroustrup, The C++ Programming Language. 3rd ed. Addison- Wesley, MA, 1997.
[20]
Yourkit LLC, Yourkit profiler. http://www.yourkir.com

Cited By

View all
  • (2018)Symbolic reasoning for automatic signal placementACM SIGPLAN Notices10.1145/3296979.319239553:4(120-134)Online publication date: 11-Jun-2018
  • (2018)Symbolic reasoning for automatic signal placementProceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3192366.3192395(120-134)Online publication date: 11-Jun-2018
  • (2017)Automatic-Signal Monitors with Multi-object Synchronization2017 IEEE International Parallel and Distributed Processing Symposium (IPDPS)10.1109/IPDPS.2017.57(927-936)Online publication date: May-2017
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PLDI '13: Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation
June 2013
546 pages
ISBN:9781450320146
DOI:10.1145/2491956
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 48, Issue 6
    PLDI '13
    June 2013
    515 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/2499370
    Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 16 June 2013

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. automatic signal
  2. concurrency
  3. explicit signal
  4. implicit signal
  5. monitor
  6. parallel

Qualifiers

  • Research-article

Conference

PLDI '13
Sponsor:

Acceptance Rates

PLDI '13 Paper Acceptance Rate 46 of 267 submissions, 17%;
Overall Acceptance Rate 406 of 2,067 submissions, 20%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)3
  • Downloads (Last 6 weeks)1
Reflects downloads up to 10 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2018)Symbolic reasoning for automatic signal placementACM SIGPLAN Notices10.1145/3296979.319239553:4(120-134)Online publication date: 11-Jun-2018
  • (2018)Symbolic reasoning for automatic signal placementProceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3192366.3192395(120-134)Online publication date: 11-Jun-2018
  • (2017)Automatic-Signal Monitors with Multi-object Synchronization2017 IEEE International Parallel and Distributed Processing Symposium (IPDPS)10.1109/IPDPS.2017.57(927-936)Online publication date: May-2017
  • (2022)Synthesizing fine-grained synchronization protocols for implicit monitorsProceedings of the ACM on Programming Languages10.1145/35273116:OOPSLA1(1-26)Online publication date: 29-Apr-2022
  • (2020)Symbolic Reasoning for Automatic Signal PlacementACM SIGOPS Operating Systems Review10.1145/3421473.342148254:1(64-76)Online publication date: 31-Aug-2020

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media