Presentation is loading. Please wait.

Presentation is loading. Please wait.

9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 1 Threads CMSC 421 Spring 2012, Section 2 Dr. Richard Carback

Similar presentations


Presentation on theme: "9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 1 Threads CMSC 421 Spring 2012, Section 2 Dr. Richard Carback"— Presentation transcript:

1 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 1 Threads CMSC 421 Spring 2012, Section 2 Dr. Richard Carback carback1@umbc.edu http://www.csee.umbc.edu/courses/undergraduate/421/Spring12/02/ Slides based on Operating Systems Concepts, 8th Edition

2 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 2 Lecture Overview ● Overview ● Multithreading Models ● Thread Libraries ● Threading Issues ● Operating System Examples ● Windows XP Threads ● Linux Threads

3 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 3

4 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 4

5 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 5

6 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 6 User v. Kernel Threads ● Thread management done by user-level threads library ● Three primary thread libraries: ● POSIX Pthreads ● Win32 threads ● Java threads ● Supported by the Kernel ● Multiple pointers/more complex PCB. ● Examples ● Windows XP/2000 ● Solaris ● Linux ● Tru64 UNIX ● Mac OS X

7 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 7

8 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 8

9 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 9

10 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 10

11 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 11 Thread Libraries ● Thread library provides programmer with API for creating and managing threads ● Two primary ways of implementing ● Library entirely in user space ● Kernel-level library supported by the OS

12 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 12

13 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 13

14 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 14

15 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 15

16 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 16

17 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 17

18 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 18

19 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 19 Linux threads ● fork() and clone() system calls ● Doesn’t distinguish between process and thread ● Uses term task rather than thread ● clone() takes options to determine sharing on process create ● struct task_struct points to process data structures (shared or unique)

20 9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 20 Questions?


Download ppt "9/30/2016 Slides based on Operating Systems Concepts, 8th Edition 1 Threads CMSC 421 Spring 2012, Section 2 Dr. Richard Carback"

Similar presentations


Ads by Google