当前位置:网站首页>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 .
边栏推荐
- Sqlserver query results are not displayed in tabular form. How to modify them
- Programmers' position in the Internet industry | daily anecdotes
- 也算是学习中的小总结
- Zynq learning notes (3) - partial reconfiguration
- [noip2008 improvement group] stupid monkey
- 2021 robocom world robot developer competition - undergraduate group (semi-finals)
- Yolov5 tensorrt acceleration
- 二叉树基本知识和例题
- Meet diverse needs: jetmade creates three one-stop development packages to help efficient development
- Biscuits (examination version)
猜你喜欢
[数学建模] 微分方程--捕鱼业的持续发展
Postman前置脚本-全局变量和环境变量
ORM aggregate query and native database operation
canal同步mysql数据变化到kafka(centos部署)
MPLS experiment
Selection of slow motion function
CADD course learning (8) -- virtual screening of Compound Library
程序员在互联网行业的地位 | 每日趣闻
IPv6 comprehensive experiment
[FreeRTOS interrupt experiment]
随机推荐
Introduction of several RS485 isolated communication schemes
CADD course learning (7) -- Simulation of target and small molecule interaction (flexible docking autodock)
[lgr-109] Luogu may race II & windy round 6
比尔·盖茨晒18岁个人简历,48年前期望年薪1.2万美元
关于es8316的音频爆破音的解决
SharedPreferences source code analysis
SQL injection vulnerability (MSSQL injection)
[HBZ share] reasons for slow addition and deletion of ArrayList and fast query
It is also a small summary in learning
Application of Flody
Upload nestjs configuration files, configure the use of middleware and pipelines
Word cover underline
Etcd database source code analysis -- etcdserver bootstrap initialization storage
[buuctf.reverse] 159_[watevrCTF 2019]Watshell
Basic knowledge and examples of binary tree
树莓派3.5寸屏幕白屏显示连接
RTP GB28181 文件测试工具
Redis has four methods for checking big keys, which are necessary for optimization
[数学建模] 微分方程--捕鱼业的持续发展
[noip2009 popularization group] score line delimitation