1 / 22

Chapter 6 - Implementing Processes, Threads and Resources

Chapter 6 - Implementing Processes, Threads and Resources. Kris Hansen Shelby Davis Jeffery Brass 3/7/05 & 3/9/05. What’s Covered. Different Process and Thread Types Hardware Processes The Abstract Machine Interface Process Abstraction Thread Abstraction State Diagrams

fay
Download Presentation

Chapter 6 - Implementing Processes, Threads and Resources

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 6 - Implementing Processes, Threads and Resources • Kris Hansen • Shelby Davis • Jeffery Brass • 3/7/05 & 3/9/05

  2. What’s Covered • Different Process and Thread Types • Hardware Processes • The Abstract Machine Interface • Process Abstraction • Thread Abstraction • State Diagrams • Resource Managers

  3. What’s Covered • Different Process and Thread Types • Hardware Processes • The Abstract Machine Interface

  4. Processes • Two Definitions of Process • Classic Process: a program in execution in a von Neumann computer • Modern Process: an OS abstraction that defines the execution environment for a thread or set of threads

  5. Thread • Definition: unit of computation with the minimal internal state and resources • Threads keep track of code execution in a given process • Modern operating systems are built with modern processes and threads in mind

  6. The Abstract Machine • The modern OS uses multiprogramming, the illusion that applications each reside inside of there own computer • The OS manages the virtual machines, via services • Services are invoked by calling API Functions

  7. APIs • API stands for Application Programming Interface • API functions are implemented by different parts of the OS: • Device Manager • Process Manager • Memory Manager • File Manager

  8. Adding Threads • In a classic system, only one thread can be running per processor, the base thread • In a modern OS, additional threads can share the host process’ resources • When an abstract machine is given it’s own multiprogrammed OS, then it is a user space thread implementation • the OS implements classic processes, and the user space thread library runs on top to simulate multiprocessing

  9. Adding Threads • Other modern OSs are built for threads, i.e. Windows, and support kernel threads • When kernel threads are supported, the notions of threads and processes are completely separate by managing both as separate entities

  10. Resources • A resource is anything that a process can request • If not available, the process is blocked • A request for a resource is made via an API call • Allocation results in the resource being configured for the abstract machine • Each resource has a unique system-wide resource identifier

  11. Process Address Space • The process address space is the collection of addresses that a thread can reference • Addresses link to memory locations or other abstract machine elements • Memory-mapped resources - those resources bound to a collection of addresses in the address space • The address space provides a uniform access method for getting memory-mapped resources

  12. Processes Address Space • Each resource manager must bind (associate, or link) addresses to resources • The OS uses the address space system to control what processes have access to resources • Modern OSs usually have 232 address (about 4GB worth,) with some supporting (or planning to support) 264 addresses

  13. OS Families • The abstract interface is determined by the host’s hardware and set of functions released by the OS • The definition of an OS is important, both for how it works on the technical side and what software is available on the business side

  14. Process Manager Responsibilities • Process Creation and Termination • Thread Creation and Termination • Process/Thread Synchronization • Resource Allocation • Resource Protection • Cooperation w/ Device Manager on IO • Address Space Implementation

  15. Final Process Composition • Address Space • Program • Data • Resources • Process Identifier

  16. Final Thread Composition • Host Process Environment • Thread Specific Data • Thread Identifier

  17. The Hardware Process • When a system boots up, there are no distinctions like processes and threads • On booting, all the computer knows is its basic hardware start up instructions, known as a bootstrap • This single thread of execution is known as the hardware process

  18. Bootstrap & Loader • The bootstrap must execute first • Executing the bootstrap leads to the loader, which starts loading the OS • After loading, the OS can initialize, polling and initializing hardware and data structures • Only after this can threads and processes be handled, by way of launching thread and process managers

  19. Initial Structures • When the OS loads, before normal execution can take place, an initial process and thread are created • It acts as a placeholder for all of the other threads and processes, it actually does nothing • This is also the idle thread (or idle process,) as this process is executed when no other processes are running

  20. The Abstract Machine Interface • In an OS, there are two types of instructions: user mode instructions and OS (supervisor mode) instructions • This protects from a program being able to access resources completely unchecked • When a certain resource is needed, or a system call is necessary, then a call must be made to the OS, which directs the call into the supervisor mode via a trap instruction

  21. Comparing System Call Interfaces • Linux Kernel version 2.0.36 has 166 system functions • Kernel version 2.4 has over 200 • Win32 has over 2,000 • The number of system calls increases the functionality of the OS, along with the overhead needed to run it

  22. Source • Nutt, Gary. Operating Systems. Boston: Pearson Education, 2004.

More Related