pmonpp: Pthread Monitor Preprocessor
Abstract
Monitors have become an exceedingly important synchronization mechanism because they are a natural generalization of the object-oriented programming. A monitor construct encapsulates private data with public methods to operate on that data. Although the Pthread library contains dozens of functions for threading and synchronization, it does not provide direct support for the monitor. Students must explicitly provide mutual exclusion around "monitor procedures" using mutex locks. However, monitor procedures by definition execute with implicit mutual exclusion. This makes it hard to teach the monitor concept in class and explain the semantic differences between monitors and semaphores. To solve this problem, we have designed and implemented a monitor preprocessor for Pthreads that provides explicit support for monitors in Pthreads.
DOI: https://doi.org/10.3844/jcssp.2006.765.769
Copyright: © 2006 Jinhua Guo. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
- 3,224 Views
- 2,376 Downloads
- 0 Citations
Download
Keywords
- Concurrent programming
- mutual exclusion
- condition synchronization
- process synchronization