Your SlideShare is downloading. ×
0
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
23565104 process-management(2)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

23565104 process-management(2)

1,313

Published on

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,313
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
73
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Module 2
  • 2. OS RESPONSIBILITIES FOR PROCESS MGMT.
    • Creating and deleting of process
    • Scheduling of a process (suspending and resuming the execution of process)
    • Process synchronization
    • Process communication
    • Deadlock handling
  • 3. WHAT IS A PROCESS?
    • Process
      • – Program in execution needing resources (such as CPU time, memory, files and I/O devices) to accomplish its tasks.
      • Executing set of machine instructions
        • Execution of a process must progress in a sequential fashion; at most one instruction is executed on behalf of the process.
  • 4. COMPONENTS OF A PROCESS
    • Code
    • Data
    • Resources
    • Status
    • Threads
  • 5. CLASSIFICATION OF OS ACCORDING TO THE TYPES OF SYSTEM:
    • Single-process single-threaded – only one process can execute at a time. Once a process is allocated to the CPU, that process runs to completion before any other process can execute.
      • Example: DOS
  • 6. CLASSIFICATION OF OS ACCORDING TO THE TYPES OF SYSTEM:
    • Multi-process single threaded – a single entity (the process), is the object upon which both resource allocation and CPU scheduling are performed.
      • Example: UNIX
  • 7. CLASSIFICATION OF OS ACCORDING TO THE TYPES OF SYSTEM:
    • Multi-process multi-threaded – resources are allocated to the processes but CPU scheduling can be in terms of thread.
      • Example: Windows, Mach, Solaris
  • 8. IS PROCESS THE SAME AS PROGRAM?
    • No, it is both more and less
      • More – a program is just part of a process context.
      • Less – a program may invoke several processes
  • 9. UNIPROGRAMMING & MULTIPROGRAMMING
    • Uniprogramming
      • allows execution of only one process at a time (e.g. personal computer)
    • Multiprogramming
      • allows more than one process (e.g. concurrent execution of many processes)
  • 10. HOW CAN SEVERAL PROCESSES SHARE ONE CPU?
    • OS takes care of this by making sure that:
      • Each process gets a chance to run
      • (fair scheduling)
      • They do not modify each other’s state
      • (protection)
  • 11. OS EXECUTION
    • An OS executes a variety of programs:
      • Batch systems
      • Time-shared systems
  • 12. A PROCESS INCLUDES:
    • Program counter and contents of processor registers.
    • Process stack (contains temporary data such as subroutine parameters, return addresses, variables)
    • Data section (contains global variables)
    • Heap
      • Memory that is dynamically allocated during run time.
  • 13. SIX (6) PROCESS STATES:
    • New
      • Process is being created but not yet included in the pool of executable processes (resource acquisition)
    • Ready
      • Waiting to be assigned to the processor
    • Running (or active)
      • Process that is currently being executed
  • 14. SIX (6) PROCESS STATES: (CONT)
    • Waiting (or blocked)
      • Waiting for some event to occur (I/O completion)
    • Stopped
      • Special case of blocked where the operator/user suspends the process.
    • Terminated (or exiting)
      • Process has finished execution. A process is about to be removed from the pool of executable processes.
  • 15. DIAGRAM OF PROCESS STATE State transition _____ internal _ _ _ _external New Ready Active Exiting Stopped Blocked create resume time-out dispatch suspend kill kill exit error Event occurs or resource available
  • 16. PROCESS CONTROL BLOCK (PCB)
    • Each process is represented in the OS by a PCB.
    • It is where collection of process information are kept and accessed.
    • Sometimes called the Task Control Block (TCB)
  • 17. PCB INFORMATION:
    • Process state
    • Program counter (PC)
    • CPU Registers
    • CPU Scheduling information
    • Memory-Management Information
    • Accounting information
    • I/O status information
  • 18. PROCESS CONTROL BLOCK
  • 19. Operations on Processes
    • Create a process
    • Destroy a process
    • Suspend a process
    • Resume a process
    • Change the priority of a process
    • Block a process
    • Wake up a process
    • Dispatch a process
    • Enable interprocess communication
  • 20. CONTEXT SWITCH
    • When a CPU switches to another process, the system must save the state of the old process and load the saved state of the new process
    • Context-switch time is overhead; the system does no useful work during switching.
  • 21. CONTEXT SWITCH
  • 22. PROCESS SCHEDULING:
    • Objective of multiprogramming: have some user process running at all times
    • OS keeps the CPU busy with productive work by dynamically selecting (scheduling) the next user process to become active.
  • 23. SCHEDULING QUEUES
    • Job queue
      • Set of all processes that enter the system
    • Ready queue (linked-list)
      • Set of all processes residing in main memory, ready and waiting to execute.
    • Device queues
      • Set of processes waiting for an I/O device, each device has a device queue.
  • 24. QUEUING DIAGRAM:
  • 25. LONG-TERM SCHEDULER (OR JOB SCHEDULER)
    • Selects which processes should be brought into the ready queue; these processes are spooled to a mass-storage (disk) where they are kept for later execution.
    • Controls the degree of multiprogramming
  • 26. LONG TERM SCHEDULER: (CONT)
    • Must make careful selection among the processes (a good process mix).
    • Processes can be described as either:
      • I/O bound process – spends more time doing I/O than computations, may short CPU bursts
      • CPU bound process – spends more time doing computations, few very long CPU bursts.
  • 27. SHORT-TERM SCHEDULER
    • Known as the CPU scheduler.
    • Selects which process should be executed next and allocates the CPU.
  • 28. MEDIUM-TERM SCHEDULER (SWAPPER)
    • Involves suspending or resuming processes by swapping or rolling them out of or into memory.
    • Swapping
      • Removing a process from the memory.
  • 29. MEDIUM-TERM SCHEDULER
  • 30. THREAD: DEFINITION
    • A basic unit of CPU utilization
    • Comprises a thread ID, program counter, register set, and a stack.
    • Process types:
      • Single-threaded – performs one task at a time
      • Multithreaded – performs more than one task at a time.
  • 31. EXAMPLES OF THREAD
    • Web browser
      • One thread – displays images/text
      • Another thread – retrieves data from network
    • Word processor
      • One thread – displays graphics
      • Another thread – responds to user keystrokes
      • Another thread – performs spelling and grammar

×