An Efficient Kernel-Based Implementation of POSIX Threads

This paper describes the kernel-based implementation of POSIX Threads (Pthreads) in the DG/UXTM operating system. The implementation achieves time efficiency by using a general-purpose trap mechanism, known as a Kernel Function Call (KFC), that carries an order of magnitude less overhead than a traditional system call. On a 50 MHz Motorola MC88110, the implementation can create and exit a thread (with the associated context switch) in 8.1 microseconds and yield to another thread in 4.0 microseconds. The implementation also achieves space efficiency by paging and decoupling bulky data structures. The advantages of a kernel-based implementation include design simplicity, less code redundancy, optimization of global (interprocess) operations, avoidance of inopportune preemption, and global semantic flexibility. The disadvantage is a monolithic design that lacks user-level flexibility.