当前位置:网站首页>A little knowledge of CPU, disk and memory
A little knowledge of CPU, disk and memory
2022-07-06 04:48:00 【licungeng】
The hardware in the computer only transmits and stores 01 Bit data .CPU Different voltages on both sides , Different results are obtained with the help of semiconductors . Operate the output voltage and input voltage of the element through language . All functions of the operating system are the scheduling kernel . If you write a program to dock with the kernel , Then the program can run in any version , If not , Will be limited by the version .
Have their own main method , What can run independently is called the main process . adopt .exe A file called main Method , Re pass main Method calls other methods . Program installation is to fill in the registration form according to the information .
Solid state disk is fast , But it has a service life , high price . The mechanical disk is slow , But there is no service life .
If the power-off data is not available, it is called flash memory , Data in is called permanent storage .
N Extremely 1,S Extremely 0.
The disk gives an initial voltage , Generate corresponding displacement and generate voltage , Read data according to voltage .
There are no sectors in Physics , Sectors are logically divided by the operating system , Each sector of the disk is the same size .
5400 turn / branch 、 Desktop computer 7200 turn / branch 、 The server 10000 turn / branch . Turn around 10ms about . Find a data average on disk 5ms about , Half a turn on average plus the swing of the manipulator .
CPU Read data from memory on average 20ns,CPU Run once on average 0.2ns.
1ms=1000μs=100 ten thousand ns.
CPU Operation can be operated at one time 64 The bit ,CPU The number of bits of the operating system depends on the amount of a single operation .
The data read from the disk will pass through a filtering device before reaching the memory , Illegal data will form a circuit break , Only legal data can form a channel . There will be location data before the data , The filtering device will judge whether the position data matches . The interference voltage will affect the internal circuit of the filter , Change the circuit , Control whether the data can pass .
Memory functions :
CPU Processing speed is too fast , The reading speed can't keep up with ,CPU Equivalent to idling , Waste resources . Memory can read data in batches . If you can support batch data reading , The disk can rotate one circle and get the data , Average 5ms, add CPU The time ratio of reading data from memory CPU It takes less time to read data directly from disk .CPU Not enough storage space , Only one data can be read one data , Time is too long .
The slow opening time of the program is from disk to memory , Running fast is memory to CPU.
CPU Pass address to memory , Memory should put that address back 1 Page total 4096 Bytes of data are passed to CPU
Bit shift , example 12bit,(5,7), each page 2^7, Yes 2^5 page
The role of the page : Support batch reading
Cache function : Reduce waiting time , Improve performance
In the mainstream CPU in , Generally, the cache is divided into level-1 cache 、 Second level cache 、 Three level cache , And the speed between them decreases , Capacity increases , Reading the information in the L1 cache requires 3 A cycle , And CPU The speed of processing operations is infinitely close , The cycle of reading L2 cache is about 10-15 A cycle , The third level cache takes 50 About a cycle .
Any core can only process one instruction at a time .
Due to the bus , At a certain moment, only one message comes from CPU The instructions of can operate on memory .
Semaphore mechanism
1、 After the first one is completely processed , Only the second one can read .
2、 After the first reading , Give the data a semaphore , After the second processing , Modify semaphore , Compare semaphores after the first one is processed , If not, read again .
Disadvantages of cache : It will cause data coverage
Lock mark : A lock mark will be added after reading the data , When the data is processed, the lock mark will be notified to be released . Semaphores do not notify , So you need to read the data again .
Saving data with arrays saves space than with variables .
The file is stored on disk , Variables exist in memory .
Sequential file storage can speed up the search , But there may be a problem of space .
Now the storage on disk is sequential storage , But when storing, there will be space left in the storage unit , It is convenient to modify data in the future
Pipelining technology will enable instruction rearrangement to reduce the number of switches , Improve overall performance , But there will be problems with multithreading .
边栏推荐
- [noip2009 popularization group] score line delimitation
- Visio draws Tai Chi
- 2021RoboCom机器人开发者大赛(初赛)
- MPLS experiment
- 关于es8316的音频爆破音的解决
- What should the project manager do if there is something wrong with team collaboration?
- [FreeRTOS interrupt experiment]
- Raspberry pie 3.5-inch white screen display connection
- Etcd database source code analysis -- etcdserver bootstrap initialization storage
- Knowledge consolidation source code implementation 3: buffer ringbuffer
猜你喜欢
MPLS experiment
[05-1, 05-02, 05-03] network protocol
RTP GB28181 文件测试工具
Is the mode of education together - on campus + off campus reliable
Introduction of several RS485 isolated communication schemes
ORM aggregate query and native database operation
[数学建模] 微分方程--捕鱼业的持续发展
Extension of graph theory
麦斯克电子IPO被终止:曾拟募资8亿 河南资产是股东
Selection of slow motion function
随机推荐
也算是学习中的小总结
Lagrange polynomial
web工程导入了mysql驱动jar包却无法加载到驱动的问题
Basic knowledge and examples of binary tree
Coreldraw2022 new version new function introduction cdr2022
Platformio create libopencm3 + FreeRTOS project
二叉树基本知识和例题
Is the mode of education together - on campus + off campus reliable
你需要知道的 TCP 三次握手
On the solution of es8316's audio burst
Visio draw fan
What should the project manager do if there is something wrong with team collaboration?
The web project imported the MySQL driver jar package but failed to load it into the driver
Complete list of common functions of turtle module
Upload nestjs configuration files, configure the use of middleware and pipelines
The IPO of mesk Electronics was terminated: Henan assets, which was once intended to raise 800 million yuan, was a shareholder
Nestjs配置文件上传, 配置中间件以及管道的使用
ETCD数据库源码分析——etcdserver bootstrap初始化存储
Implementation of knowledge consolidation source code 1: epoll implementation of TCP server
关于imx8mp的es8316的芯片调试