Processes
Download
1 / 11

Processes - PowerPoint PPT Presentation


  • 157 Views
  • Uploaded on

Processes. Chapter 3. Processes in Distributed Systems. Processes and threads Introduction to threads Distinction between threads and processes Threads in distributed systems Clients/servers Code migration Motivation and models Migration in heterogeneous systems. Processes.

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

PowerPoint Slideshow about 'Processes' - gezana


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
Processes

Processes

Chapter 3


Processes in distributed systems
Processes in Distributed Systems

  • Processes and threads

    • Introduction to threads

    • Distinction between threads and processes

  • Threads in distributed systems

    • Clients/servers

  • Code migration

    • Motivation and models

    • Migration in heterogeneous systems


Processes1
Processes

  • Virtual processors

    • Created by OS to execute a program

    • Process table to keep track of virtual processors

  • Process is a program in execution

    • Executed on one of the virtual processors

  • Operating systems ensure that processes are independent and transparent

    • Do not affect each other’s correctness

    • Resource sharing is transparent

  • Address space


Costs of processes
Costs of Processes

  • Processes are costly

  • Creating a process requires creation of an entire new address space

    • Initializing memory segment, copying instructions to text segment, initializing stack

  • Switching b/w processes is costly as well

    • Saving CPU context, modify registers of the memory management unit, TLBs, swapping processes (if number of processors are larger than what can fit in main memory)


Threads
Threads

  • Similar to a process

    • Perceived as execution of (a part of) program

    • Information maintained for sharing CPU is minimal

  • Context of threads is captured by CPU context

    • May be a little more information is needed for management (like locks)

  • Very little overheads

    • Thread switching is easy

  • Can provide performance gains


Threads in non distributed systems
Threads in Non-Distributed Systems

  • With processes a blocking system call blocks the entire process

    • Interactive programs like spreadsheets

    • Computations cannot proceed while waiting on user inputs or vice-versa

    • Having two threads can solve problems

  • Parallel programs

    • Multiple threads, single address space

  • Cooperating programs need to communicate

    • IPCs are costly


Drawbacks of ipcs
Drawbacks of IPCs

  • Needs kernel intervention (due to separate address spaces)

  • Multiple context switches

  • Context switches are costly (changing MMU, flushing TLB)


Implementing threads
Implementing Threads

  • Implemented as package

    • Creation, destruction, synchronization

  • Simpler approach – User level thread library

    • All thread management is done at user level

    • Kernel not even that there are multiple threads

  • Thread creation, destruction and context switching are cheap

    • Creating stack

    • Saving registers

  • Drawback – Blocking system call blocks entire process


Lightweight process
Lightweight Process

  • A hybrid approach

  • Lightweight process runs in context of single process

  • Reside in kernel

  • System also offers user-level threads

    • All operations occur in user mode

  • Thread package can be shared by multiple LWPs

  • LWP is created by kernel and given its own stack



Lwps continued
LWPs Continued

  • LWP has a scheduling routine and searches for a thread to execute

    • Thread pool

  • Context switching to a thread if found

  • On mutex, context switching happens if a runnable thread is found

    • LWP need not be informed

  • LWP context switching happens on a blocking system call

  • Several advantages

    • Cheap, will not block entire process, extends to multiprocessing environment


ad