Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Birrell - An Introduction to Programming With Threads

Birrell - An Introduction to Programming With Threads

Ratings: (0)|Views: 46|Likes:
Published by api-3813935

More info:

Published by: api-3813935 on Oct 18, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

d i g i t a l
Systems Research Center
130 Lytton Avenue
Palo Alto, California 94301
3 5
An Introduction to Programming
with Threads
by Andrew D. Birrell
January 6, 1989
An Introduction to Programming with Threads
Andrew D. Birrell

This paper provides an introduction to writing concurrent programs with \u201cthreads\u201d. A threads facility allows you to write programs with multiple simultaneous points of execution, synchronizing through shared memory. The paper describes the basic thread and synchronization primitives, then for each primitive provides a tutorial on how to use it. The tutorial sections provide advice on the best ways to use the primitives, give warnings about what can go wrong and offer hints about how to avoid these pitfalls. The paper is aimed at experienced programmers who want to acquire practical expertise in writing concurrent programs.

CR categories and Subject Descriptors: D.1.4 [Programming Techniques]: Concurrent
Programming; D.3.3 [Programming Languages]: Language Constructs\u2014Concurrent
programming structures; D.4.1 [Operating Systems]: Process Management
General Terms: Design, Languages, Performance
Additional Key Words and Phrases: Threads, Concurrency, Multi-processing, Synchronization
CONTENTS

Introduction...................................................................................................... 1 Why use concurrency?........................................................................................ 2 The design of a thread facility.............................................................................. 3 Using a Mutex: accessing shared data.................................................................... 7 Using a Condition variable: scheduling shared resources.......................................... 14 Using Fork: working in parallel......................................................................... 22 Using Alert: diverting the flow of control............................................................ 27 Additional techniques....................................................................................... 28 Building your program..................................................................................... 30 Concluding remarks......................................................................................... 31 References...................................................................................................... 31 Appendix: other thread designs........................................................................... 33

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->