当前位置:网站首页>20、 Processor scheduling (RR time slice rotation, mlfq multi-level feedback queue, CFS fully fair scheduler, priority reversal; multiprocessor scheduling)
20、 Processor scheduling (RR time slice rotation, mlfq multi-level feedback queue, CFS fully fair scheduler, priority reversal; multiprocessor scheduling)
2022-06-24 09:32:00 【[T]】
One 、 Simplified processor scheduling problem
Interrupt mechanism
1、 The processor is interrupted at a fixed frequency
(1)linux kernel It can be set to :100/250/300/1000Hz
2、 interrupt / When the system call returns, you can freely select the process / Threads
Simplified assumptions for processor scheduling problems
1、 There is a processor in the system
2、 There are multiple processes in the system / Thread sharing CPU
(1) system call ( process / Part of the thread code is in syscall In the implementation of )
(2) wait for I/O return , Do not apply CPU
Two 、 Strategy
1、RR(Round-Robin) Time slice rotation
2、 priority
(1)Unix niceness
-20 ~ 19
The bigger the value is. , Said to CPU The lower priority the resource gets

taskset -c 0 nice -n 19 yes > /dev/null &
taskset -c 0 nice -n 9 yes > /dev/null &
niceness The value difference of 10,CPU Poor resources 10 times
3、 Dynamic priority (MLFQ)
(1) Several RR queue
Each queue has a priority
(2) Dynamic priority adjustment strategy
Priority scheduling high priority queues
Use up the time slice -》NI Low value
4、CFS Completely fair scheduler
(1) Record the exact running time for each process
(2) interrupt / After the exception , Switch to the process with the least running time
Next time interrupt / After abnormality , The current process may not be the smallest
(3) Maintain collection
to update vrt(t)<- vrt(t)+dt
Take the smallest vrt
Process creation / sign out / sleep / Insert on wakeup / Delete t
3、 ... and 、 Processor scheduling
1、 Priority flipping
Low priority holds the lock waiting for high priority , Lead to high priority processes / The thread is by a low priority process / Thread blocking
(1) Priority inheritance , Low priority holds the same lock as high priority , Will inherit the priority of high priority
2、 Multiprocessor
(1) transfer ,cash Copying consumes resources
(2) Don't move , Can cause CPU waste ( It's hard for one core , Multi core onlookers )
3、 Single threaded tasks and multithreaded tasks CPU Possession problem
4、 Different types of cores (A55、A75、A78), To assign tasks, you need to know the core computing power
边栏推荐
- The native applet uses canvas to make posters, which are scaled to the same scale. It is similar to the uniapp, but the writing method is a little different
- Leetcode-- string
- Vidéo courte recommandée chaque semaine: Soyez sérieux en parlant de "métaunivers"
- Pytoch read data set (two modes: typical data set and user-defined data set)
- [ES6 breakthrough] promise is comparable to native custom encapsulation (10000 words)
- 【LeetCode】541. Reverse string II
- Linux (centos7.9) installation and deployment of MySQL Cluster 7.6
- 什么情况下应该使用GridFS?
- 深入解析 Apache BookKeeper 系列:第三篇——读取原理
- 【gdb调试工具】| 如何在多线程、多进程以及正在运行的程序下调试
猜你喜欢

实战剖析:app扫码登陆实现原理(app+网页端详细逻辑)附源码

NETRCA: AN EFFECTIVE NETWORK FAULT CAUSE LOCALIZATION之论文阅读

【ES6闯关】Promise堪比原生的自定义封装(万字)

Cdga | how can we do well in data governance?

Numpy numpy中的np.c_和np.r_详解

目标检测系列——Fast R-CNN

CF566E-Restoring Map【bitset】

小白学习MySQL - 增量统计SQL的需求

Recommendation - Secret of curiosity: how many dancing angels can stand on the tip of a needle?

The border problem after the focus of input
随机推荐
Epidemic situation, unemployment, 2022, we shouted to lie down!
Zero foundation self-study SQL course | syntax sequence and execution sequence of SQL statements
How to import MDF and LDF files into MySQL workbench
Go language project development practice directory
The border problem after the focus of input
零基础自学SQL课程 | 子查询
eBanb B1手环刷固件异常中断处理
Depens:*** but it is not going to be installed
Time series data augmentation for deep learning: paper reading of a survey
leetcode--字符串
P6117-[joi 2019 final] greedy
Numpy NP in numpy c_ And np r_ Explain in detail
When programmers are asked if they can repair computers... | daily anecdotes
Weekly recommended short video: talk about "meta universe" with a serious attitude
达梦数据库如何定位锁等待问题解决方法
Alibaba Senior Software Testing Engineer recommends testers to learn -- Introduction to security testing
2020 China's provinces and cities, three-level linkage data, data agencies (data from the official website of the National Bureau of Statistics)
Target detection series fast r-cnn
[bug] @jsonformat has a problem that the date is less than one day when it is used
带文字的seekbar : 自定义progressDrawable/thumb :解决显示不全