View Full Document


Unformatted text preview:

C THREADS Eric C Cooper Richard P Draves Department of Computer Science Carnegie Mellon University Pittsburgh Pennsylvania 15213 Draft of 11 September 1990 ABSTRACT The C Threads package allows parallel programming in C under the MACH operating system The package provides multiple threads of control for parallelism shared variables mutual exclusion for critical sections and condition variables for synchronization of threads This research was sponsored by the Defense Advanced Research Projects Agency DoD ARPA order 4864 monitored by the Space and Naval Warfare Systems Command under contract N00039 84 C 0467 The views and conclusions contained in this document are those of the authors and should not be interpreted as representing official policies either expressed or implied of the Defense Advanced Research Projects Agency or of the U S Government 1 Introduction MACH provides a set of low level language independent primitives for manipulating threads of control 3 The C Threads package is a run time library that provides a C language interface to these facilities 1 The constructs provided are similar to those found in Mesa 4 and Modula 2 5 forking and joining of threads protection of critical regions with mutex variables and synchronization by means of condition variables 2 Naming Conventions An attempt has been made to use a consistent style of naming for the abstractions implemented by the C Threads package All types macros and functions implementing a given abstract data type are prefixed with the type name and an underscore The name of the type itself is suffixed with t and is defined via a C typedef Documentation of the form typedef struct mutex mutex t indicates that the mutex t type is defined as a pointer to a referent type struct mutex which may itself be useful to the programmer In cases where the referent type should be considered opaque documentation such as typedef cthread t is used instead Continuing the example of the mutex t type the functions mutex

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...

Join to view threads and access 3M+ class-specific study document.

We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view threads and access 3M+ class-specific study document.


By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?