[OS]Process Scheduling

Multi-programming

  • Multiple processes exist in the system
  • Select a process to allocate resources
    • Scheduling
  • Resource Management
    • time sharing
      • Process scheduling
    • space sharing
      • memory

Purpose of Scheduling

  • Improves system performance
  • System Performance index
    • response time
    • throughput
    • resource utilization

Scheduling Criteria

  • I/O-bounded or compute-bounded
  • Batch system or interactive system
  • process urgency
  • process priority
  • process total service time

CPU burst vs I/O burst

  • Performing the Process
    • Use CPU + I/O
  • compute-bounded
    • CPU burst > I/O burst
  • I/O-bunded
    • I/O burst > CPU burst

Scheduling Level

  • Long-term scheduling
    • Job scheduling
  • Mid-term scheduling
    • Memory allocation
  • Short-term scheduling
    • Process scheduling

Long-term Scheduling

  • Job scheduling
  • Multiprogramming degree control
    • Controlling the number of processes in the system

Mid-term Scheduling

  • Memory allocation
    • Intermediate-level scheduling
    • Swapping(swap-in/swap-out)

Short-term Scheduling

  • Process scheduling
    • Low-level scheduling
    • Determine the process by which to allocate processors
  • Most frequent occurrence

Scheduling policy

  • Preemptive scheduling, Non-preemptive scheduling
  • Priority

Non-preemptive scheduling

  • system call, I/O, Etc.
  • Low context switch overhead
  • Frequent priority reversals, increased average response time

Preemptive scheduling

  • High context switch overhead
  • Time-sharing system, real-time system

Priority

  • Staic priority
  • Dynamic priority

Reference

Process Scheduling