chapter04 - Process Resource ownership - process is...

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

View Full Document Right Arrow Icon
1 Threads Chapter 4 Process Resource ownership - process is allocated a virtual address space to hold the process image, may be allocated control and ownership of resources. the OS performs a protection function to prevent unwanted interference between processes with respect to resources Scheduling/execution - follows an execution path that may be interleaved with other processes a process has an execution state (Running, Ready, etc.) and a dispatching priority and is scheduled and dispatched by the OS These two characteristics are treated independently by the operating system Process The unit of dispatching is referred to as a thread or lightweight process The unit of resource ownership is referred to as a process or task Multithreading - The ability of an OS to support multiple, concurrent paths of execution within a single process Multithreading The ability of an operating system to support multiple, concurrent paths of execution within a single process. A single thread of execution per process, in which the concept of a thread is not recognized, is referred to as a single-threaded approach. MS-DOS is am example. UNIX supports multiple user processes but only supports one thread per process. A Java run-time environment is an example of a system of one process with multiple threads. Windows, Solaris, many modern versions of UNIX support multiple processes, multiple threads per process. Process In a multithreaded environment, a process is defined as the unit of resource allocation and a unit of protection. Have a virtual address space which holds the process image Protected access to processors, other processes, files, and I/O resources
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Thread Within a process, there may be one or more threads, each with the following: An execution state (running, ready, etc.) Saved thread context when not running Has an execution stack Some per-thread static storage for local variables Access to the memory and resources of its process all threads of a process share this Threads vs. Processes Benefits of Threads Takes less time to create a new thread than a process Less time to terminate a thread than a process Less time to switch between two threads within the same process than to switch between two processes. Enhance efficiency in communication between different executing programs. Since threads within the same process share memory and files, they can communicate with each other without invoking the kernel. Thread Use in a Single-User
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/26/2011 for the course CSE 410 taught by Professor Bonakdarpour during the Spring '08 term at Michigan State University.

Page1 / 8

chapter04 - Process Resource ownership - process is...

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

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