Loading...
Please wait, while we are loading the content...
Similar Documents
Rthreads: a new thread implementation for openbsd.
| Content Provider | CiteSeerX |
|---|---|
| Author | Unangst, Ted |
| Abstract | The next generation thread library for OpenBSD will be rthreads. Based on the rfork() system call, rthreads improve the performance, robustness, and scalability of OpenBSD's thread support. In contrast to other recent threading models introduced to BSD systems, rthreads is not based on scheduler activations. The existing userland pthreads has carried us a long way but it's been showing its age recently. As more applications place more demanding requirements on the thread library its shortcomings become more apparent. This paper will explain these problems, highlight how rthreads resolve them, and then continue with an overview of the rthreads implementation. Threads Briefly, threading opens up a new programming model for a developer to use, instead of asynchronous I/O or an event loop. While POSIX defines an API for threads, called pthreads, several implementations are possible. The core of any threading implementation needs to provide two fundamentals, concurrency and synchronization. Concurrency allows a programm to accomplish multiple tasks, while providing the programmer with an abstraction that only one task need be addressed at a time. Synchronization permits multiple threads to interact in an orderly manner. Userland Threads One way to implement threads is entirely as a userspace library. The userlandapproach has two advantes. First, it works on operating systems which don't natively support threads. Second, for some tasks, it offers good performance. By not involving the kernel, syscall overhead is avoided. By the same token, however, the kernel is unaware of the thread library's intentions. This means that it is subject to inoppurtune scheduling by the kernel. There's no true concurrency, but the only illusion of concurrency, achieved by replacing potentially blocking I/O calls with nonblocking calls. In practice, however, nonblocking I/O has a tendency to block, notably when reading from the filesystem. select() and poll() will always indicate that data is available, even when it isn't in the buffer cache. If one thread blocks waiting for data from disk, all threads in the same process block. This drawback severely handicaps the ability of any userland thread library to provide concurrency. |
| File Format | |
| Access Restriction | Open |
| Subject Keyword | Next Generation Thread Library Userland Thread Library Support Thread Multiple Task Orderly Manner Syscall Overhead Thread Library Multiple Thread Scheduler Activation Buffer Cache Thread Support Threading Implementation Need Demanding Requirement Long Way Thread Briefly Bsd System Userland Pthreads Good Performance Userspace Library Event Loop New Programming Model Task Need Rthreads Implementation Userland Thread One Way Thread Block New Thread Implementation System Call Several Implementation True Concurrency Process Block |
| Content Type | Text |
| Resource Type | Article |