Abstract-An operating system serves as a fundamental component of any computer system. Scheduling lies at the core of operating system functionality, involving the arrangement of processes to execute in a well-defined manner. The primary goal of scheduling is to enhance system efficiency and speed. Several fundamental scheduling algorithms exist, including First Come First Serve (FCFS), Round Robin, Priority-Based Scheduling, and Shortest Job First (SJF). This thesis primarily focuses on the Round Robin Scheduling algorithm and seeks to address certain limitations associated with it. One notable drawback of Round Robin Scheduling is the critical choice of the time quantum. If the time quantum is excessively large, the scheduling behavior closely resembles that of FCFS. Conversely, a smaller time quantum leads to a higher number of context switches. The central objective here is to overcome this limitation inherent to the traditional Round Robin scheduling algorithm, thereby maximizing CPU utilization and enhancing system efficiency. In this thesis, we propose an innovative algorithm that classifies processes into two categories: high-priority processes and low-priority processes. This novel scheme significantly reduces the average waiting time of high-priority processes, regardless of the presence of low-priority processes. The overall average waiting time varies based on the specific set of processes under consideration. Our analysis demonstrates that the proposed scheme consistently outperforms previously suggested methods, resulting in reduced average waiting times for the selected process sets. # I. Introduction PU scheduling is a fundamental practice in the realm of operating systems, orchestrating the execution of processes to efficiently utilize the CPU. This practice becomes necessary when a process must seize CPU control while another process is temporarily halted in a waiting state, typically due to resource unavailability, such as I/O operations. The primary objectives of CPU scheduling are to enhance system effectiveness, responsiveness, and fairness while maximizing CPU utilization. Process scheduling, an integral component of multiprogramming operating systems, involves managing the transition of processes in and out of the CPU based on a specific strategy. These operating systems can load multiple processes into executable memory concurrently, allowing them to share the CPU through time multiplexing. There are two principal categories of CPU scheduling algorithms: preemptive and non-preemptive. In preemptive scheduling, a process allocated to the CPU can be interrupted, and its running state may be changed to a waiting state. This approach is known for temporarily suspending logically runnable processes and is referred to as preemptive scheduling. However, frequent arrivals of high-priority processes in the ready queue can potentially lead to starvation for lower-priority processes. It's important to note that preemptive scheduling comes with the overhead of managing these process interruptions. In contrast, non-preemptive scheduling ensures that once a process gains access to the CPU, it retains control until its execution is complete. The CPU cannot be forcibly taken away from the process until it finishes its execution. In this scenario, a process voluntarily releases the processor only after its task is done. While various CPU scheduling algorithms exist, some common ones include First In First Out (FIFO), Shortest Job First (SJF), Priority Scheduling, and Round Robin CPU Scheduling. Each of these algorithms offers unique advantages and trade-offs in managing the CPU's allocation to processes. # II. Literature Survey In FCFS scheduling, jobs are executed in the order they arrive, following a "first come, first served" principle [1]. This algorithm can operate in both nonpreemptive and preemptive modes depending on system requirements. It is easy to understand and implement, relying on a First-In-First-Out (FIFO) queue. However, FCFS suffers from the drawback of high average waiting times, limiting its overall performance. Shortest Job First (SJF), also known as Shortest Job Next, prioritizes tasks based on their execution time [3]. It can function as both a preemptive and nonpreemptive algorithm. SJF is particularly effective in reducing waiting times, making it a preferred choice in batch systems where CPU time requirements are known C in advance. However, it is impractical for interactive systems where predicting CPU time is challenging. Priority scheduling is a non-preemptive algorithm commonly used in batch systems [5]. Each process is assigned a priority, with the highest-priority process scheduled first, followed by processes of equal priority in a first-come-first-served manner. Priorities can be assigned based on memory, time, or other resource requirements. Round Robin is a preemptive scheduling algorithm where each process is allocated a fixed time quantum for execution [8]. When a process's time quantum expires, it is preempted, and another process is allowed to execute for its allocated time period. Context switching is necessary to manage preempted processes effectively. Multiple-level queues are a manual scheduling algorithm [15] that leverages various existing algorithms to categorize jobs based on common characteristics. Multiple queues are maintained for processes with similar attributes, each with its specific scheduling algorithm [8]. Priorities are assigned to each queue, enabling effective organization. For instance, OS-bound jobs can be grouped in one queue, while I/O-bound jobs reside in another. The Process Scheduler selects jobs from each queue based on the algorithm associated with that queue. Multi-level queue scheduling was developed for scenarios where processes naturally belong to different groups. # III. Shortcomings of Existing Algorithm We have evaluated the conventional Round Robin (RR) algorithm as our baseline scheduling approach. The RR algorithm is generally considered efficient because it ensures that all processes in the process set have an equal opportunity for execution. However, our research has identified that our system comprises both critical processes with high priority and normal (low-priority) processes. A significant limitation of the RR algorithm is its lack of consideration for process priorities, which we regard as a major drawback. To address this limitation, we have proposed a novel methodology aimed at enhancing the RR algorithm's effectiveness. Let's now consider the following set of processes with a fixed time quantum of 4. Round Robin scheduling is known for its ability to ensure a fair chance for every process in the set to execute. Consequently, Figure 1 illustrates the Gantt chart and waiting times for the given set of processes. # Figure 1: Gantt chart of Existing Methodology The average waiting time (AWT) for processes with both low and high priorities is presented in Figure 2 below. # Optimized Round Robin CPU Scheduling for Critical Processes # Global Journal of Computer Science and Technology ( H ) XXIII Issue III Version I Year 2023 # IV. Proposed Method The Round Robin algorithm operates under the premise of treating all jobs with equal priority, executing processes one at a time for a specific duration known as the Time Quantum (TQ). A process can continue running until either its time quantum (TQ) is exhausted or it completes its CPU burst time. Within the system, processes have varying priorities, distinguishing between high-priority critical tasks, which demand immediate CPU attention, such as shutting down the computer due to overheating or issuing alerts for unauthorized access, and normal-priority processes, which encompass all other standard tasks. # V. Proposed Algorithm Our proposed algorithm is given below. Step 1: Input process details, including the process name, priority, and burst time. Step 2: Save the collected information in a queue labeled as "READYQ." Step 3: Establish two distinct queues: "HIGHPQ" for high-priority processes and "LOWPQ" for regular-priority processes. Step 4: Repeat steps 5 to 11 until the remaining CPU burst times for processes in both "HIGHPQ" and "LOWPQ" reach zero. Step 5: Choose the next process from "HIGHPQ" or "LOWPQ" alternatively, with the initial selection favoring "HIGHPQ" to give higher-priority tasks precedence. Step 6: If the selected process has a remaining CPU burst time greater than or equal to the time quantum, proceed to step 7; otherwise, go to step 8. Step 7: Execute the chosen process for the duration of the time quantum. Step 8: Continue executing the selected process until its remaining burst time reaches zero. Step 9: Update the remaining CPU burst time of the corresponding process in the respective queue. Step 10: Record the process's IN-TIME and OUT-TIME in a table known as the GANTTCHART. Step 11: If the previous process was selected from "HIGHPQ," switch the next turn to "LOWPQ," and vice versa. In this study, I have introduced an approach that ensures high-priority processes receive precedence in execution. The methodology I've suggested involves granting alternating opportunities to both high and low priority processes. It begins by selecting a process from the high-priority queue, followed by the selection of the next process from the low-priority queue. The following steps outline the proposed methodology. HIGHPQ-This queue contains the processes of high priority. # Process Name Priority Burst Time Below, in Figure 3, you can observe the Gantt chart and waiting times for the processes listed in Table 1, using a time quantum of 4. # Optimized Round Robin Scheduling for Critical Processes # Global Journal of Computer Science and Technology ( H ) XXIII Issue III Version I Year 2023 # VI. Result and Analysis The figure below illustrates the application of the proposed algorithm, resulting in an average waiting time for high-priority processes of approximately 7.5. This value is nearly half of the average waiting time observed when using the existing algorithm. Furthermore, the overall waiting time for the process set is significantly reduced through the implementation of the proposed algorithm. # Figure 4: Result Analyses of Existing Vs Proposed Methodology The same result can be analyzed using bar chart shown in figure 5. # Optimized Round Robin CPU Scheduling for Critical Processes # Global Journal of Computer Science and Technology ( H ) XXIII Issue III Version I Year 2023 # VII. Conclusion In this study, I've maintained the core principle of traditional round-robin scheduling, which aims to ensure that all processes receive an equal opportunity to execute within a specific time quantum. The innovation lies in the strategic placement of high-priority processes at the rear of the ready queue, preventing them from being excessively delayed by late arrivals. The proposed approach is expected to reduce the average waiting time for high-priority processes, but it may lead to an increase in the average waiting time for normal priority processes. The overall average waiting time for all processes within the ready queue may exhibit improvement or remain unchanged, contingent on the specific mix of processes. Although the proposed algorithm demonstrates enhanced performance for high-priority processes, there remains an ongoing drive for continued improvement. In the future, these results could potentially be refined by introducing variable time quantum strategies. Furthermore, optimizing the algorithm's execution can be accomplished by leveraging more efficient data structures. 2![Figure 2: Waiting Time Analysis of Existing Methodology](image-2.png "Figure 2 :") 3![Figure 3: Working of Proposed Methodology](image-3.png "Figure 3 :") 5![Figure 5: Result Analysis of Existing Vs Proposed Methodology Using Bar chart](image-4.png "Figure 5 :") ![](image-5.png "") 1Ready QueueProcess NamePriorityBurst TimeP005P113P2112P309P408 © 2023 Global Journals * An Effective Round Robin Algorithm using Min-Max Dispersion Measure SanjayKumar Panda SauravKumar Bhoi International Journal on Computer Science and Engineering 4 1 January 2012 * Operating System Concepts AbrahamSilberschatz PeterBaer Galvin GregGagne Sixth Edition * Design and Performance Evaluation of a New Proposed Shortest Remaining Burst Round Robin (SRBRR) Scheduling Algorithm HSRakesh Mohanty KhusbuBehera MonishaPatwari Dash Proc. of International Symposium on Computer Engineering & Technology of International Symposium on Computer Engineering & Technology 2010. 2010 17 * An AbdulrazakAbdulrahim SalisuAliyu AhmadMMustapha &Saleh EAbdullahi 2014 * An Effective Round Robin Algorithm using Min-Max Dispersion Measure SanjayaPanda SouravKumar; Bhoi Kumar International Journal on Computer Science & Engineering 4 1 45 Jan2012 * Designing Various CPU Scheduling Techniques using SCILAB Saini Mona 2014 5 2918 * Self-Adjustment Time Quantum in Round Robin Algorithm Depending on Burst Time of the Now Running Processes. Matarneh, Rami j 2009 6 1831 * Seif-Adjustment Time Quantum in Round Robin Algorithm Depending on Burst Time of the Now Running Proceses RJMatarneh American Journal of Applied Sciences 6 10 2009 * A New Proposed Dynamic Quantum with Re-Adjusted Round Robin Scheduling Algorithm and Its Performance Analysis HSBehera RMohanty DNayak International Journal of Computer Applications 5 5 August 2010 * Performance Assessment of Some CPU Scheduling Algori-thms EOOyetunji AEOluleye Research Journal of Information Techno-logy 1 1 2009 * An Optimized Round Robin Scheduling Algorithm for CPU Scheduling AjitSingh PriyankaGoyal SahilBatra IJCSE) International Journal on Computer Science and Engineering 02 07 2010 * Self-Adjustment Time Quantum in Round Robin Algorithm Depending on Burst Time of Now Running Processes JRami Matarneh American J. of Applied Sciences 6 10 2009 * A New Improved Round Robin (NIRR) CPU Scheduling Algorithm AbdulrazakAbdulrahim ESaleh Abdullahi BJunaidu Sahalu International Journal of Computer Applications 90 4 2014 * Enhancing cpu performance using subcontrary mean dynamic round robin (smdrr) scheduling algorithm SouravKumar Bhoi SanjayaKumar Panda DebasheeTarai JGRCS 2 12 December 2011 * Design and Performance Evaluation of a New Proposed Shortest Remaining Burst Round Robin (SRBRR) Scheduling Algorithm HSRakesh Mohanty KhusbuBehera MonishaPatwari Dash International Symposium on Computer Engineering & Technology (ISCET) 2010 17 * A Priority based Round Robin CPU Scheduling Algorithm for Real Time Systems IshwariSingh Rajput IJIET)International Journal of Innovations in Engineering and Technology 1 3 Oct 2012 * An Improved Round Robin CPU Scheduling Algorithm Journal of Global Research in Computer Science ManishKumar Mishra AbdulKadirKhan 3 6 2012 * A FINEST TIME QUANTUM FOR IMPROVING SHORTEST REMAINING BURST ROUND ROBIN (SRBRR) ALGORITHM PSurendraVarma Journal of Global Research in Computer Science 4 3 March 2013 * An Improved Round Robin Scheduling Algorithm for CPU Scheduling RakeshKumar Yadav KAbhishek NavinMishra HimanshuPrakash Sharma IJCSE) International Journal on Computer Science and Engineering 02 04 2010