chapter 6 implementing processes threads and resources n.
Skip this Video
Loading SlideShow in 5 Seconds..
Chapter 6 - Implementing Processes, Threads and Resources PowerPoint Presentation
Download Presentation
Chapter 6 - Implementing Processes, Threads and Resources

Loading in 2 Seconds...

play fullscreen
1 / 22

Chapter 6 - Implementing Processes, Threads and Resources - PowerPoint PPT Presentation

  • Uploaded on

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

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Chapter 6 - Implementing Processes, Threads and Resources' - whitley

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
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
What’s Covered
  • Different Process and Thread Types
  • Hardware Processes
  • The Abstract Machine Interface
  • Process Abstraction
  • Thread Abstraction
  • State Diagrams
  • Resource Managers
what s covered1
What’s Covered
  • Different Process and Thread Types
  • Hardware Processes
  • The Abstract Machine Interface
  • 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
  • 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
the abstract machine
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
  • API stands for Application Programming Interface
  • API functions are implemented by different parts of the OS:
    • Device Manager
    • Process Manager
    • Memory Manager
    • File Manager
adding threads
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
adding threads1
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
  • 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
process address space
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
processes address space
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
os families
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
process manager responsibilities
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
final process composition
Final Process Composition
  • Address Space
  • Program
  • Data
  • Resources
  • Process Identifier
final thread composition
Final Thread Composition
  • Host Process Environment
  • Thread Specific Data
  • Thread Identifier
the hardware process
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
bootstrap loader
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
initial structures
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
the abstract machine interface
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
comparing system call interfaces
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
  • Nutt, Gary. Operating Systems. Boston: Pearson Education, 2004.