Skip to main content

CSE HELPLINE

LAB MANUAL for Data And Telecommunications

  Router Configuration Lab Report 1. Introduction Objective : The purpose of this lab is to configure a router with various settings and verify the communication between devices on different networks. Tools/Software Used : Cisco Packet Tracer, GNS3, Physical Router etc. Topology : Brief description of the network topology, including the routers, switches, and devices used.                                 যদি কারো ল্যাব রিপোর্ট লাগে কমেন্টে ইমেইল কমেন্ট করে দিন পাঠানো হবে। Lab Report PDF

What is CPU Scheduling?

 

Introduction to CPU Scheduling

CPU scheduling plays a vital role in how the CPU allocates its resources to multiple processes. Since a CPU can only execute one process at a time (in most systems), efficient scheduling is essential to improve system performance. The operating system’s scheduler selects which process runs next from the ready queue, considering various factors such as process priority, burst time, and fairness.

Types of CPU Scheduling Algorithms

  1. First-Come, First-Served (FCFS)
    FCFS is the simplest scheduling algorithm. The process that arrives first gets executed first.

    • Advantages: Simple and easy to implement.
    • Disadvantages: It can lead to the “convoy effect” where shorter processes get stuck behind longer ones, resulting in higher average waiting time.
    • Use Case: Batch processing systems.
  2. Shortest Job Next (SJN)
    Also known as Shortest Job First (SJF), this algorithm selects the process with the shortest CPU burst.

    • Advantages: Minimizes average waiting time and is optimal in theory.
    • Disadvantages: Requires knowledge of the burst time in advance and can suffer from the “starvation” of longer processes.
    • Use Case: Suitable for systems where process execution times can be predicted accurately.
  3. Priority Scheduling
    Each process is assigned a priority, and the process with the highest priority is executed first.

    • Advantages: Flexibility to prioritize important tasks.
    • Disadvantages: Can lead to starvation of lower-priority processes unless aging is used (increasing the priority of a process over time).
    • Use Case: Real-time systems where certain tasks must be completed within strict time constraints.
  4. Round Robin (RR)
    Each process is assigned a fixed time slice (quantum) in a cyclic order.

    • Advantages: Fair to all processes and ensures that no process waits too long.
    • Disadvantages: Context switching adds overhead, and performance depends on the time quantum size.
    • Use Case: Time-sharing systems.
  5. Multilevel Queue Scheduling
    Processes are divided into different queues based on their type (foreground, background, etc.). Each queue can have its own scheduling algorithm.

    • Advantages: Allows for differentiated treatment of processes based on their priority or type.
    • Disadvantages: Less flexible and difficult to tune effectively.
    • Use Case: Systems where processes have varying priority levels or requirements, such as real-time tasks.
  6. Multilevel Feedback Queue Scheduling
    Similar to multilevel queue scheduling, but processes can move between queues based on their behavior and requirements.

    • Advantages: Adapts to different types of processes dynamically, reducing the possibility of starvation.
    • Disadvantages: Complex to implement.
    • Use Case: General-purpose systems that handle diverse workloads.

Performance Metrics for CPU Scheduling

  • CPU Utilization: The percentage of time the CPU is actively working on processes. A good scheduler maximizes this.
  • Throughput: The number of processes completed in a given period. Higher throughput means better performance.
  • Turnaround Time: The time taken from process submission to its completion.
  • Waiting Time: The total time a process spends in the ready queue.
  • Response Time: The time from process submission to its first response.

Conclusion

Choosing the right CPU scheduling algorithm depends on the system's goals, whether it be maximizing throughput, minimizing waiting time, or ensuring fairness. No single algorithm works best in every scenario, and often a hybrid or specialized approach is used to balance system performance.




Comments

Popular Posts