CS345 04 - Threads

CS345 04 - Threads - Topics to Cover Processes Threads RPCs...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
BYU CS 345 Threads 1 Topics to Cover… Processes Threads RPC’s Thread Issues ULT’s KLT’s Thread Management
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
BYU CS 345 Threads 2 UNIX Process States
Background image of page 2
Processes and Threads Chapter 4
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
BYU CS 345 Threads 4 Consider… A Process is a unit of: Resource ownership Code, Data, Address space I/O channels, devices, files Execution path “Time on the clock” Current state Interleaved with other processes What if we treat each independently? Unit of resource ownership process or task Unit of execution thread or lightweight process Processes
Background image of page 4
BYU CS 345 Threads 5 Processes Resources owned by a process: code ("text"), data (VM), stack, heap, file I/O, and signal tables. Processes have a significant amount of overhead: Tables have to be flushed from the processor when context switching. Processes share information only through pipes and shared memory. Threads
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
BYU CS 345 Threads 6 Threads A thread of execution Smallest unit of processing that can be scheduled by an operating system Threads reduce overhead by sharing the resources of a process. Switching can happen more frequently and efficiently. Sharing information is not so "difficult" anymore - everything can be shared. A Thread is an independent program counter operating within a process. Sometimes called a lightweight process (LWP) A smaller execution unit than a process. Threads
Background image of page 6
BYU CS 345 Threads 7 Threads and Processes one process one thread multiple processes one thread per process multiple processes multiple threads per process one process multiple threads Threads
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
BYU CS 345 Threads 8 Multi-threading Operating system or user may support multiple threads of execution within a single process. Traditional approach is single process, single threaded. Current support for mult-process, mult-threading. Examples: MS-DOS: single user process, single thread. UNIX: multiple processes, one thread per process. Java run-time environment: one process, multiple threads. Windows 2000 (W2K), Solaris, Linux, Mach, and OS/2: multiple processes, each supports multiple threads. Threads
Background image of page 8
BYU CS 345 Threads 9 Threads There are two types of threads: user-space (ULT) and kernel-space (KLT). A thread consists of: a thread execution state (Running, Ready, etc.) a context (program counter, register set.) an execution stack. some per-tread static storage for local variables.
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/02/2012 for the course C S 345 taught by Professor Ericmercer during the Winter '12 term at BYU.

Page1 / 26

CS345 04 - Threads - Topics to Cover Processes Threads RPCs...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online