Method for fairly scheduling multiple processes of computer
Through real-time monitoring and dynamic adjustment, I/O-intensive and CPU-intensive processes are identified, priority and time slices are adjusted, and scheduling is solved in the existing technology, and system resource utilization efficiency and overall performance are improved.
Patent Information
- Application Number
- CN202411377535.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-07
AI Technical Summary
In the prior art, the scheduling of I/O-intensive processes and CPU-intensive processes is prone to unfairness, resulting in a reduction in overall system efficiency and insufficient resource utilization or waste.
By monitoring the CPU usage time and I/O waiting time of the process in real time, dynamically identify the process type, and adjust the priority and time slice according to the type, increase the priority of I/O-intensive processes, and reduce the priority of CPU-intensive processes. Dynamically adjust the length of the time slice and introduce a feedback mechanism to adjust the scheduling strategy based on the response time and turnover time.
Targeted scheduling of different types of processes is realized, resource utilization efficiency is improved, overall system performance is improved, and resource waste and waiting time is increased.
Smart Images

Figure CN119271376A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multi-process resource allocation in a parallel computer architecture, and in particular to a computer multi-process fair scheduling method. Background Art
[0002] In a multiprogramming system, the number of processes is often greater than the number of processors, so it is inevitable that processes compete for processors. Processor scheduling is the allocation of processors, that is, selecting a process from the ready queue according to a certain algorithm and allocating the processor to it to run, so as to realize the concurrent execution of processes.
[0003] For example, the patent with publication number CN104636200B discloses a method for fair scheduling of multiple processes in a computer, comprising the following steps: Step 1: extracting processes that can be concurrently scheduled from a process set to form a scheduling set, and forming unscheduled processes in the process set into a backup scheduling queue; Step 2: determining whether the process scheduling request has ended, if not, executing the next step, otherwise the scheduling ends; Step 3: scheduling the scheduling set; Step 4: placing the scheduled processes at the end of the backup scheduling queue; Step 5: clearing the scheduling set; Step 6: selecting processes that can be concurrently scheduled from the backup scheduling queue to form a new scheduling set, and jumping to Step 2. This invention constructs a scheduling set and a backup scheduling queue for processes through set operations, thereby achieving fair scheduling of multiple processes by the computer processor, avoiding deadlock during concurrent scheduling of processes, and improving the scheduling capability of the computer processor for concurrent processes.
[0004] Although the above scheme has the above advantages, in traditional scheduling algorithms, such as round-robin scheduling or priority scheduling, the scheduling of I / O-intensive processes and CPU-intensive processes is prone to unfairness. I / O-intensive processes usually frequently give up the CPU when waiting for I / O operations to complete, while CPU-intensive processes occupy the CPU for a long time, resulting in increased response time of I / O-intensive processes and reduced overall system efficiency. At the same time, the differences between different processes are ignored, resulting in the inability to schedule I / O-intensive and CPU-intensive processes in a targeted manner, causing insufficient or wasteful resource utilization. Therefore, a method for fair multi-process scheduling of computers is urgently needed to solve such problems. Summary of the Invention
[0005] In response to the deficiencies of the prior art, the present invention provides a method for fair scheduling of multiple computer processes to solve the problems in the prior art that the scheduling of I / O-intensive processes and CPU-intensive processes is prone to unfairness, the overall efficiency of the system is reduced, and I / O-intensive and CPU-intensive processes cannot be scheduled in a targeted manner, resulting in insufficient or wasted resources.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions:
[0007] The present invention provides a method for fair scheduling of computer multi-processes, comprising:
[0008] Step 1: Process classification and feature recognition: By monitoring the running status of processes in real time, we can identify whether each process is I / O-intensive or CPU-intensive.
[0009] Step 2. Dynamic priority adjustment: Dynamically adjust the priority based on the process classification. Specific adjustment strategies include:
[0010] I / O-intensive process priority boost: For identified I / O-intensive processes, their priority is temporarily boosted after the I / O operation is completed.
[0011] Lower the priority of CPU-intensive processes: For CPU-intensive processes, maintain their initial priority and lower it after running for a period of time to prevent them from occupying CPU resources for a long time.
[0012] Step 3. Dynamic time slice adjustment: Based on round-robin scheduling, the time slice is dynamically adjusted in combination with the process type:
[0013] For I / O-intensive processes, shorter time slices enable them to frequently enter I / O operations and return promptly, thus reducing waiting time;
[0014] For CPU-intensive processes with longer time slices, reduce the overhead of frequent context switching and improve CPU utilization;
[0015] Step 4. Introduce a feedback mechanism to continuously adjust the scheduling strategy based on the actual operating results and monitor the response time and turnaround time of the process: evaluate the effectiveness of the scheduling strategy based on the response time and turnaround time; adjust the priority and time slice allocation strategy: if the response time of a certain type of process increases significantly, adjust its priority and time slice allocation strategy.
[0016] The present invention is further configured such that the feature recognition and classification step includes:
[0017] Real-time monitoring of the CPU usage time and I / O waiting time of each process;
[0018] Calculate CPU usage and I / O wait time, and classify processes;
[0019] Add two fields to the PCB of each process: cpu_time and io_time, which are used to record the CPU usage time and I / O waiting time of the process respectively;
[0020] Read the current CPU usage time and I / O waiting time of each process at regular intervals;
[0021] By periodically collecting data, the CPU usage and I / O waiting time of each process in a given time period are calculated;
[0022] Calculate the increment within the time interval: Δcpu_time = cpu_time(t) - cpu_time(t-1), Δio_time = io_time(t) - io_time(t-1), where t and t-1 represent the current read time and the previous read time, respectively, and Δcpu_time and Δio_time represent the change in CPU time and I / O wait time within a given time period, respectively;
[0023] Use incremental data to calculate CPU usage and I / O wait time ratio: Where Δcpu_% and Δio_% represent the CPU usage and I / O waiting time percentage respectively;
[0024] The present invention is further configured such that the feature recognition and classification step further comprises:
[0025] Based on the collected feature data, the processes are classified as I / O-intensive or CPU-intensive, and the classification thresholds for CPU usage and I / O waiting time are set;
[0026] Let the classification thresholds of CPU usage and I / O waiting time be α and β respectively;
[0027] If Δio_%>β, it is classified as I / O intensive;
[0028] If Δcpu_% > α, it is classified as CPU intensive;
[0029] The present invention is further configured as follows: the dynamic priority adjustment method includes:
[0030] Add fields for priority adjustment in the process control block PCB, including:
[0031] priority: current priority;
[0032] base_priority: initial priority;
[0033] io_completion_time: the time when the most recent I / O operation was completed;
[0034] When the I / O operation of an I / O-intensive process is completed, the priority is increased;
[0035] For CPU-intensive processes, lower their priority after running for a period of time;
[0036] The present invention is further configured as follows: the I / O intensive priority raising step includes:
[0037] Monitor I / O operation completion events. Each time a process's I / O operation is completed, the current time is recorded as io_completion_time.
[0038] Priority improvement method: new_prio = base_prio + Δp io , where new_prio is the new priority, base_prio is the initial priority of the process, Δp io Priority increment for I / O-bound processes;
[0039] The present invention is further configured such that the step of reducing the priority of a CPU-intensive process includes:
[0040] Monitor CPU running time and calculate the cumulative running time of CPU-intensive processes at each time interval;
[0041] Priority reduction method: Here Δp io Indicates the amount of priority reduction each time, T run is the cumulative running time, T dec The time threshold that triggers the reduction of priority;
[0042] The present invention is further configured as follows: the dynamic time slice adjustment method is:
[0043] Dynamically adjust the time slice length according to the process type I / O intensive and CPU intensive,
[0044] Initialize the PCB and add fields for time slice adjustment in the process control block PCB, including:
[0045] time_slice: the length of the current time slice;
[0046] base_time_slice: initial time slice length;
[0047] process_type: process type, I / O intensive, CPU intensive;
[0048] The dynamic time slice adjustment strategy is,T io =T base ×α,T cpu =T base ×β, where T io Indicates the time slice length of the I / O-intensive process, Tcpu Indicates the time slice length of the CPU-intensive process, T base is the length of the reference time slice, α and β are adjustment coefficients, satisfying α<1 and β>1;
[0049] Select the corresponding time slice length according to the process classification:
[0050] If the process is I / O intensive, set the time slice to T io ;
[0051] If the process is CPU-intensive, set the time slice to T cpu ;
[0052] The present invention is further configured as follows: in step 4, monitoring process performance indicators is performed, response time and turnaround time are calculated based on the performance indicator detection, and the effectiveness of the scheduling strategy is evaluated;
[0053] Add fields to the PCB of each process to record the arrival time, first CPU acquisition time and completion time of the process;
[0054] Whenever a process arrives at the system, gets the CPU for the first time, and completes execution, the corresponding timestamp is recorded;
[0055] Calculate the response time and turnaround time of each process based on the recorded timestamps;
[0056] Calculate the average response time and average turnaround time of all processes; evaluate the effectiveness of the current scheduling strategy by comparing with the preset thresholds;
[0057] If the average response time or average turnaround time significantly exceeds the threshold, it indicates that there is a problem with the current scheduling strategy;
[0058] The present invention is further configured to: dynamically adjust the priority and time slice allocation strategy including:
[0059] Set response time thresholds and turnaround time thresholds, detect process performance indicators in the system, and determine whether adjustments are needed;
[0060] If the response time or turnaround time of a certain type of process increases significantly, adjust the priority and time slice allocation strategy accordingly;
[0061] The present invention is further configured as follows: the priority and time slice allocation strategy includes:
[0062] For processes with long response times, increase their priority and shorten their time slices;
[0063] For processes with long turnaround times, lower their priority and extend their time slices.
[0064] Compared with the prior art, the present invention has the following beneficial effects:
[0065] The present invention introduces dynamic identification of process characteristics. By real-time monitoring of the CPU usage time and I / O waiting time of the process, the process is dynamically classified into I / O intensive and CPU intensive types, so that the scheduling system can adapt to the needs of different types of processes and improve resource utilization efficiency.
[0066] The present invention designs different priority adjustment strategies for different types of processes. For I / O-intensive processes, the priority is temporarily increased after the I / O operation is completed to reduce waiting time; for CPU-intensive processes, the priority is lowered after running for a period of time to prevent long-term CPU resource occupation, better meeting the needs of different types of processes and improving the overall performance of the system;
[0067] The present invention dynamically adjusts the time slice length according to the process type. For I / O-intensive processes, a shorter time slice is allocated to reduce waiting time; for CPU-intensive processes, a longer time slice is allocated to reduce context switching overhead. The dynamic adjustment of the time slice length can better balance the execution requirements of different types of processes and improve the resource utilization efficiency of the system.
[0068] The present invention solves the problem that the scheduling of I / O-intensive processes and CPU-intensive processes is prone to unfairness, which reduces the overall efficiency of the system and makes it impossible to schedule I / O-intensive and CPU-intensive processes in a targeted manner, resulting in insufficient or wasted resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 This is a flow chart of the method for fair scheduling of computer multi-processes of the present invention. DETAILED DESCRIPTION
[0070] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0071] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0072] The present invention is described in further detail below with reference to the accompanying drawings:
[0073] Example
[0074] See also Figure 1 The present invention provides a method for fair scheduling of multiple processes in a computer, comprising:
[0075] Step 1: Process classification and feature recognition: By monitoring the running status of processes in real time, we can identify whether each process is I / O-intensive or CPU-intensive.
[0076] The feature recognition and classification steps include:
[0077] Real-time monitoring of the CPU usage time and I / O waiting time of each process;
[0078] Calculate CPU usage and I / O wait time, and classify processes;
[0079] Add two fields to the PCB of each process: cpu_time and io_time, which are used to record the CPU usage time and I / O waiting time of the process respectively;
[0080] Read the current CPU usage time and I / O waiting time of each process at regular intervals;
[0081] By periodically collecting data, the CPU usage and I / O waiting time of each process in a given time period are calculated;
[0082] Calculate the increment within the time interval: Δcpu_time = cpu_time(t) - cpu_time(t-1), Δio_time = io_time(t) - io_time(t-1), where t and t-1 represent the current read time and the previous read time, respectively, and Δcpu_time and Δio_time represent the change in CPU time and I / O wait time within a given time period, respectively;
[0083] Use incremental data to calculate CPU usage and I / O wait time ratio: Where Δcpu_% and Δio_% represent the CPU usage and I / O waiting time percentage respectively;
[0084] The feature recognition and classification steps also include:
[0085] Based on the collected feature data, the processes are classified as I / O-intensive or CPU-intensive, and the classification thresholds for CPU usage and I / O waiting time are set;
[0086] Let the classification thresholds of CPU usage and I / O waiting time be α and β respectively;
[0087] If Δio_%>β, it is classified as I / O intensive;
[0088] If Δcpu_% > α, it is classified as CPU intensive;
[0089] Identify in real time whether a process is I / O-bound or CPU-bound;
[0090] Step 2. Dynamic priority adjustment: Dynamically adjust the priority based on the process classification. Specific adjustment strategies include:
[0091] Priority boost for I / O-intensive processes: For identified I / O-intensive processes, their priority is temporarily boosted after I / O operations are completed, allowing them to quickly obtain CPU resources and complete subsequent processing, thus reducing response time.
[0092] Lower the priority of CPU-intensive processes: For CPU-intensive processes, maintain their initial priority and lower it after running for a period of time to prevent them from occupying CPU resources for a long time.
[0093] Dynamic priority adjustment methods include:
[0094] Add fields for priority adjustment in the process control block PCB, including:
[0095] priority: current priority;
[0096] base_priority: initial priority;
[0097] io_completion_time: the time when the most recent I / O operation was completed;
[0098] When the I / O operation of an I / O-intensive process is completed, the priority is increased;
[0099] For CPU-intensive processes, lower their priority after running for a period of time;
[0100] The I / O-intensive prioritization steps include:
[0101] Monitor I / O operation completion events. Each time a process's I / O operation is completed, the current time is recorded as io_completion_time.
[0102] Priority improvement method: new_prio = base_prio + Δp io , where new_prio is the new priority, base_prio is the initial priority of the process, Δp io Priority increment for I / O-bound processes;
[0103] The steps to reduce the priority of CPU-intensive processes include:
[0104] Monitor CPU running time and calculate the cumulative running time of CPU-intensive processes at each time interval;
[0105] Priority reduction method: Here Δp io Indicates the amount of priority reduction each time, T run is the cumulative running time, T dec The time threshold that triggers the reduction of priority;
[0106] Step 3. Dynamic time slice adjustment: Based on round-robin scheduling, the time slice is dynamically adjusted in combination with the process type:
[0107] For I / O-intensive processes, shorter time slices enable them to frequently enter I / O operations and return promptly, thus reducing waiting time;
[0108] For CPU-intensive processes with longer time slices, reduce the overhead of frequent context switching and improve CPU utilization;
[0109] The dynamic time slice adjustment method is:
[0110] Dynamically adjust the time slice length according to the process type I / O intensive and CPU intensive,
[0111] Initialize the PCB and add fields for time slice adjustment in the process control block PCB, including:
[0112] time_slice: the length of the current time slice;
[0113] base_time_slice: initial time slice length;
[0114] process_type: process type, I / O intensive, CPU intensive;
[0115] The dynamic time slice adjustment strategy is,T io =T base ×α,T cpu =T base ×β, where T io Indicates the time slice length of the I / O-intensive process, T cpu Indicates the time slice length of the CPU-intensive process, T base is the length of the reference time slice, α and β are adjustment coefficients, satisfying α<1 and β>1;
[0116] Select the corresponding time slice length according to the process classification:
[0117] If the process is I / O intensive, set the time slice to T io ;
[0118] If the process is CPU-intensive, set the time slice to T cpu ;
[0119] Dynamically adjust the time slice length according to the process type to effectively optimize the system's response speed and resource utilization efficiency;
[0120] Step 4. Introduce a feedback mechanism to continuously adjust the scheduling strategy based on actual operation results. Monitor the response time and turnaround time of the process: Evaluate the effectiveness of the scheduling strategy based on the response time and turnaround time. Adjust the priority and time slice allocation strategy: If the response time of a certain process increases significantly, adjust its priority and time slice allocation strategy.
[0121] In step 4, the process performance indicators are monitored, the response time and turnaround time are calculated based on the performance indicators, and the effectiveness of the scheduling strategy is evaluated;
[0122] Add fields to the PCB of each process to record the arrival time, first CPU acquisition time and completion time of the process;
[0123] Whenever a process arrives at the system, gets the CPU for the first time, and completes execution, the corresponding timestamp is recorded;
[0124] Calculate the response time and turnaround time of each process based on the recorded timestamps;
[0125] Response time is the time interval from when a process is submitted to the system to when it first obtains the CPU, and turnaround time is the total time from when a process is submitted to the system to when it completes execution;
[0126] Calculate the average response time and average turnaround time of all processes; evaluate the effectiveness of the current scheduling strategy by comparing with the preset thresholds;
[0127] If the average response time or average turnaround time significantly exceeds the threshold, it indicates that there is a problem with the current scheduling strategy;
[0128] Dynamically adjust priority and time slice allocation strategies include:
[0129] Set response time thresholds and turnaround time thresholds, detect process performance indicators in the system, and determine whether adjustments are needed;
[0130] If the response time or turnaround time of a certain type of process increases significantly, adjust the priority and time slice allocation strategy accordingly;
[0131] Priority and time slice allocation strategies include:
[0132] For processes with long response times, increase their priority and shorten their time slices;
[0133] For processes with long turnaround times, lower their priority and extend their time slices.
[0134] The present invention dynamically divides processes into I / O intensive and CPU intensive types through process classification and feature identification. By monitoring the CPU usage time and I / O waiting time of each process and calculating the CPU usage rate and I / O waiting time ratio, the process type is accurately determined and a scheduling strategy is set for each process. Different priority adjustment strategies are formulated for different types of processes in dynamic priority adjustment: for I / O intensive processes, their priority is increased after the I / O operation is completed, shortening the waiting time and reducing the response time; for CPU intensive processes, their priority is lowered after running for a period of time to prevent long-term occupation of CPU resources. Differentiated priority adjustment strategies can better meet the needs of different types of processes and improve the overall performance of the system.
[0135] In addition, in dynamic time slice adjustment, the time slice length is dynamically adjusted according to the process type. For I / O-intensive processes, a shorter time slice is allocated, allowing frequent I / O operations and timely return, reducing waiting time; for CPU-intensive processes, a longer time slice is allocated, reducing the overhead of frequent context switching and improving CPU utilization. By dynamically adjusting the time slice length, the execution requirements of different types of processes are better balanced, improving the resource utilization efficiency of the system;
[0136] Finally, in the feedback mechanism step, the effectiveness of the scheduling strategy is evaluated by monitoring the response time and turnaround time of the process, and the priority and time slice allocation strategy are dynamically adjusted according to the evaluation results. If the response time or turnaround time of a certain type of process increases significantly, its priority and time slice are adjusted accordingly.
[0137] The above content is only for explaining the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.
Claims
1. A method for fair scheduling of multi-processes in a computer, characterized in that: include: Step 1: Process classification and feature recognition: By monitoring the running status of the process in real time, identify whether each process is I / O intensive or CPU intensive; Step 2. Dynamic priority adjustment: dynamically adjust the priority according to the process classification. The specific adjustment strategies include: I / O-intensive process priority increase: For identified I / O-intensive processes, their priority is temporarily increased after the I / O operation is completed; Lower the priority of CPU-intensive processes: For CPU-intensive processes, keep the initial priority, and lower the priority after running for a period of time to prevent them from occupying CPU resources for a long time; Step 3. Dynamic time slice adjustment: Based on round-robin scheduling, dynamically adjust the time slice in combination with the process type: For I / O-intensive processes with shorter time slices, they can frequently enter I / O operations and return in time, thus reducing waiting time; For CPU-intensive processes with longer time slices, reduce the overhead of frequent context switching and improve CPU utilization; Step 4. Introduce a feedback mechanism to continuously adjust the scheduling strategy based on the actual operating results and monitor the response time and turnaround time of the process: evaluate the effectiveness of the scheduling strategy based on the response time and turnaround time; adjust the priority and time slice allocation strategy: if the response time of a certain type of process increases significantly, adjust its priority and time slice allocation strategy.
2. A computer multi-process fair scheduling method according to claim 1, characterized in that: The feature recognition and classification steps include: Real-time monitoring of the CPU usage time and I / O waiting time of each process; Calculate CPU usage and I / O waiting time, and classify processes; Add two fields to the PCB of each process: cpu_time and io_time, which are used to record the CPU usage time and I / O waiting time of the process respectively; Read the current CPU usage time and I / O waiting time of each process at regular intervals; By periodically collecting data, the CPU usage and I / O waiting time of each process in a given period of time are calculated; Calculate the increment within the time interval: Δcpu_time = cpu_time(t) - cpu_time(t-1), Δio_time = io_time(t) - io_time(t-1), where t and t-1 represent the current read time and the previous read time, respectively, and Δcpu_time and Δio_time represent the changes in CPU time and I / O waiting time within a given time period, respectively; Use incremental data to calculate CPU usage and I / O wait time ratio: Δcpu_% and Δio_% represent the CPU usage and I / O waiting time percentage respectively.
3. A computer multi-process fair scheduling method according to claim 2, characterized in that: The feature recognition and classification steps also include: Based on the collected feature data, the processes are classified into I / O intensive and CPU intensive, and the classification thresholds of CPU usage and I / O waiting time are set; Assume that the classification thresholds of CPU usage and I / O waiting time are α and β respectively; If Δio_%>β, it is classified as I / O intensive; If Δcpu_%>α, it is classified as CPU intensive.
4. A method for fair scheduling of multi-processes in a computer according to claim 3, characterized in that: Dynamic priority adjustment methods include: Add fields for priority adjustment in the process control block PCB, including: priority: current priority; base_priority: initial priority; io_completion_time: the time when the most recent I / O operation was completed; When the I / O operation of an I / O-intensive process is completed, the priority is increased; For CPU-intensive processes, lower their priority after running for a period of time.
5. A computer multi-process fair scheduling method according to claim 4, characterized in that: The I / O-intensive priority promotion steps include: Monitor I / O operation completion events. Each time a process's I / O operation is completed, the current time is recorded as io_completion_time. Priority enhancement method: new_prio = base_prio + Δp io , where new_prio is the new priority, base_prio is the initial priority of the process, Δp io The priority increment to set for I / O-bound processes.
6. A computer multi-process fair scheduling method according to claim 5, characterized in that: The steps to reduce the priority of CPU-intensive processes include: Monitor CPU running time, and calculate the cumulative running time of CPU-intensive processes at each time interval; Priority reduction method: Here, Δp io Indicates the amount of priority reduction each time, T run is the cumulative running time, T dec The time threshold that triggers a reduction in priority.
7. A computer multi-process fair scheduling method according to claim 6, characterized in that: The dynamic time slice adjustment method is: Dynamically adjust the time slice length according to the process type I / O intensive, CPU intensive, Initialize the PCB and add fields for time slice adjustment in the process control block PCB, including: time_slice: the length of the current time slice; base_time_slice: initial time slice length; process_type: process type, I / O intensive, CPU intensive; The dynamic time slice adjustment strategy is,T io =T base ×α,T cpu =T base ×β, where T io Indicates the time slice length of the I / O-intensive process, T cpu Indicates the time slice length of the CPU-intensive process, T base is the length of the reference time slice, α and β are adjustment coefficients, satisfying α<1 and β>1; Select the corresponding time slice length according to the process classification: If the process is I / O intensive, set the time slice to T io ; If the process is CPU intensive, set the time slice to T cpu .
8. A computer multi-process fair scheduling method according to claim 7, characterized in that: In step 4, the process performance indicators are monitored, the response time and turnaround time are calculated based on the performance indicator detection, and the effectiveness of the scheduling strategy is evaluated; Add fields to the PCB of each process to record the arrival time, first CPU acquisition time and completion execution time of the process; Whenever a process arrives at the system, gets the CPU for the first time, and completes execution, the corresponding timestamp is recorded; Based on the recorded timestamps, the response time and turnaround time of each process are calculated; Calculate the average response time and average turnaround time for all processes; Evaluate the effectiveness of the current scheduling strategy by comparing it with the preset threshold; If the average response time or average turnaround time exceeds the threshold significantly, it indicates that there is a problem with the current scheduling strategy.
9. A computer multi-process fair scheduling method according to claim 8, characterized in that: Dynamically adjust the priority and time slice allocation strategies include: Set response time thresholds and turnaround time thresholds, detect process performance indicators in the system, and determine whether adjustments are needed; If the response time and turnaround time of a certain type of process increase significantly, adjust the priority and time slice allocation strategy according to the situation.
10. A computer multi-process fair scheduling method according to claim 9, characterized in that: Priority and time slice allocation strategies include: For processes that take too long to respond, increase their priority and shorten their time slices; For processes with long turnaround time, lower their priority and extend their time slice.
Citation Information
Patent Citations
A method for fair scheduling of multiple computer processes
CN104636200B
Cited By
EBPF-based high IO load adaptive scheduling method
CN121807505A