CS330 · Chapter 4 · Annotated SlidesThreads and Concurrency
Original
Overview

Threads and Concurrency

Why threads, single vs. multithreaded processes, benefits, multicore programming and its challenges, concurrency vs. parallelism, user and kernel threads, and the many-to-one, one-to-one, many-to-many and two-level models.

How to read this page

Every original slide is shown unchanged. Yellow marks on a slide point to a numbered note: hover or tap a mark to jump to its note, and hover a note to see its marks. Questions tagged Past exam appeared on a real paper; Prediction questions are likely angles, not confirmed. Pick an answer to each question: a wrong pick tells you why it is wrong, so you can try again.

All 21 slides
  1. 1 Chapter 4: Threads & Concurrency
  2. 2 Outline of this Topic
  3. 3 Objectives
  4. 4 Motivation
  5. 5 Threads
  6. 6 Single and Multithreaded Processes
  7. 7 Examples of Using Threads
  8. 8 Multithreaded Server Architecture
  9. 9 Benefits
  10. 10 Multicore Programming
  11. 11 cont. Multicore Programming
  12. 12 Concurrency vs. Parallelism
  13. 13 User Threads
  14. 14 Kernel Threads
  15. 15 User and Kernel Threads
  16. 16 Multithreading Models
  17. 17 Many-to-One
  18. 18 18
  19. 19 Many-to-Many
  20. 20 Two-level Model
  21. 21 Slide 21
Slide 1 / 21

Chapter 4: Threads & Concurrency

Slide 1: Chapter 4: Threads & Concurrency
Slide 2 / 21

Outline of this Topic

Slide 2: Outline of this Topic
Slide 3 / 21

Objectives

Slide 3: Objectives
Slide 4 / 21

Motivation

Slide 4: Motivation
Slide 5 / 21

Threads

Slide 5: Threads

Exam angle

PredictionQ1

Which is NOT shared between threads of the same process?

Slide 6 / 21

Single and Multithreaded Processes

Slide 6: Single and Multithreaded Processes
Slide 7 / 21

Examples of Using Threads

Slide 7: Examples of Using Threads
Slide 8 / 21

Multithreaded Server Architecture

Slide 8: Multithreaded Server Architecture
Slide 9 / 21

Benefits

Slide 9: Benefits

Exam angle

PredictionQ1

Which is a benefit of multithreading?

Slide 10 / 21

Multicore Programming

Slide 10: Multicore Programming
Slide 11 / 21

cont. Multicore Programming

Slide 11: cont. Multicore Programming
Slide 12 / 21

Concurrency vs. Parallelism

Slide 12: Concurrency vs. Parallelism

Notes

  1. Concurrency: more than one task making progress (possible on one core by interleaving). Parallelism: tasks running at the same time (needs multiple cores).

  2. Memory trick Parallelism ⇒ concurrency, but concurrency does not need parallelism.

Exam angle

PredictionQ1

Concurrency is possible on a single-core system.

PredictionQ2

Parallelism is possible on a single-core system.

Slide 13 / 21

User Threads

Slide 13: User Threads
Slide 14 / 21

Kernel Threads

Slide 14: Kernel Threads
Slide 15 / 21

User and Kernel Threads

Slide 15: User and Kernel Threads
Slide 16 / 21

Multithreading Models

Slide 16: Multithreading Models
Slide 17 / 21

Many-to-One

Slide 17: Many-to-One

Exam angle

PredictionQ1

In the many-to-one model, if one thread makes a blocking system call:

Slide 18 / 21

18

Slide 18: 18
Slide 19 / 21

Many-to-Many

Slide 19: Many-to-Many
Slide 20 / 21

Two-level Model

Slide 20: Two-level Model
Slide 21 / 21

Slide 21

Slide 21: Slide 21