USENIX Association Proceedings of the FREENIX Track: 2003 USENIX Annual Technical Conference San Antonio, Texas, USA June 9-14, 2003 THE ADVANCED COMPUTING SYSTEMS ASSOCIATION © 2003 by The USENIX Association All Rights Reserved For more information about the USENIX Association: Phone: 1 510 528 8649 FAX: 1 510 548 5738 Email:
[email protected] WWW: http://www.usenix.org Rights to individual papers remain with the author or the author's employer. Permission is granted for noncommercial reproduction of the work for educational or research purposes. This copyright notice must be included in the reproduced paper. USENIX acknowledges all trademarks herein. An Implementation of User-level Restartable Atomic Sequences on the NetBSD Operating System Gregory McGarry
[email protected] Abstract system[1]. While the kernel component of the model controls the switching of execution contexts, the user- This paper outlines an implementation of restartable level component is responsible for scheduling threads atomic sequences on the NetBSD operating system onto the available execution contexts. The user-level as a mechanism for implementing atomic operations component contains a complete scheduler implementa- in a mutual-exclusion facility on uniprocessor sys- tion with shared scheduling data which must be pro- tems. Kernel-level and user-level interfaces are dis- tected by the mutual-exclusion facility. Consequently, cussed along with implementation details. Issues as- the mutual-exclusion facility is a critical component of sociated with protecting restartable atomic sequences the scheduler activations threading model. from violation are considered. The performance of The basic building block for any mutual-exclusion fa- restartable atomic sequences is demonstrated to out- cility, whether it be a blocking or busy-wait construct, is perform syscall-based and emulation-based atomic op- the fetch-modify-write operation[5].