ABSTRACT
Visibility is a property of a programming language's memory model that determines when values stored by one concurrent computation become visible to other computations. Our work exploits the insight that in nesC, a C-like language with explicit atomicity, the traditional way of ensuring timely visibility---volatile variables---can be entirely avoided. This is advantageous because the volatile qualifier is a notorious source of programming errors and misunderstandings. Furthermore, the volatile qualifier hurts performance by inhibiting many more optimizations than are necessary to ensure visibility. In this paper we extend the semantics of nesC's atomic statements to include a visibility guarantee, we show two ways that these semantics can be implemented, and we also show that our better implementation has no drawbacks in terms of resource usage.
- Andrei Alexandrescu, Hans Boehm, Kevlin Henney, Doug Lea, and Bill Pugh. Memory model for multithreaded C++, September 2004. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1680.pdf.Google Scholar
- AVR C Runtime Library Project. AVR libc Frequently Asked Questions, 2006. http://www.nongnu.org/avr-libc/user-manual/FAQ.html.Google Scholar
- Hans-Juergen Boehm. Threads cannot be implemented as a library. In Proc. of the ACM SIGPLAN 2005 Conf. on Programming Language Design and Implementation (PLDI), pages 261--268, Chicago, IL, June 2005. Google ScholarDigital Library
- Crossbow Technology, Inc. http://xbow.com.Google Scholar
- David Gay, Phil Levis, Robert von Behren, Matt Welsh, Eric Brewer, and David Culler. The nesC language: A holistic approach to networked embedded systems. In Proc. of the Conf. on Programming Language Design and Implementation (PLDI), pages 1--11, San Diego, CA, June 2003. Google ScholarDigital Library
- Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, and Kristofer Pister. System architecture directions for networked sensors. In Proc. of the 9th Intl. Conf. on Architectural Support for Programming Languages and Operating Systems (ASPLOS), pages 93--104, Cambridge, MA, November 2000. Google ScholarDigital Library
- Herb Sutter. Prism: A principle-based sequential memory model for microsoft native code platforms, July 2006. Draft, available from http://www.gotw.ca/memmodel/Prism%20-%20draft%200.8.pdf.Google Scholar
- Ben L. Titzer, Daniel Lee, and Jens Palsberg. Avrora: Scalable sensor network simulation with precise timing. In Proc. of the 4th Intl. Conf. on Information Processing in Sensor Networks (IPSN), Los Angeles, CA, April 2005. Google ScholarDigital Library
- Linus Torvalds. Anti-volatile diatribe, July 2006. Linux-Kernel Mailing List posting, http://lkml.org/lkml/2006/7/6/159.Google Scholar
Index Terms
- Atomicity and visibility in tiny embedded systems
Recommendations
A criterion for atomicity
AbstractMost proof methods for reasoning about concurrent programs are based upon theinterleaving semantics of concurrent computation: a concurrent program is executed in a stepwise fashion, with only one enabled action being executed at each step. ...
Store Atomicity for Transactional Memory
We extend the notion of Store Atomicity [Arvind and Jan-Willem Maessen. Memory model = instruction reordering + store atomicity. In ISCA '06: Proceedings of the 33rd annual International Symposium on Computer Architecture, 2006] to a system with atomic ...
Ensuring relaxed atomicity for flexible transactions in multidatabase systems
Global transaction management requires cooperation from local sites to ensure the consistent and reliable execution of global transactions in a distributed database system. In a heterogeneous distributed database (or multidatabase) environment, various ...
Comments