当前位置:网站首页>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 .
边栏推荐
- Easyrecovery reliable and toll free data recovery computer software
- Why does MySQL need two-phase commit
- Redis has four methods for checking big keys, which are necessary for optimization
- Redis - redis in action - redis actual combat - actual combat Chapter 1 - SMS login function based on redis - redis + token shared session application - with code
- Ue5 small knowledge freezerendering view rendered objects in the cone
- Excellent PM must experience these three levels of transformation!
- ETCD数据库源码分析——etcdserver bootstrap初始化存储
- Postman管理测试用例
- yolov5 tensorrt加速
- Leetcode 186 Flip the word II in the string (2022.07.05)
猜你喜欢
ETCD数据库源码分析——etcdserver bootstrap初始化存储
Postman pre script - global variables and environment variables
ORM aggregate query and native database operation
Ue5 small knowledge points to enable the setting of lumen
几种RS485隔离通讯的方案介绍
Flink kakfa data read and write to Hudi
canal同步mysql数据变化到kafka(centos部署)
Uva1592 Database
Visio draw fan
How to realize automatic playback of H5 video
随机推荐
Scala function advanced
Sqlserver query results are not displayed in tabular form. How to modify them
Postman前置脚本-全局变量和环境变量
MPLS experiment
ISP learning (2)
2021RoboCom机器人开发者大赛(初赛)
Redis 排查大 key 的4种方法,优化必备
Acwing week 58
Weng Kai C language third week 3.1 punch in
[Yu Yue education] reference materials of complex variable function and integral transformation of Northwestern Polytechnic University
Ue5 small knowledge points to enable the setting of lumen
内核判断i2c地址上是否挂载外设
2021 RoboCom 世界机器人开发者大赛-本科组(复赛)
Postman关联
Distributed transaction solution
[try to hack] John hash cracking tool
Is the mode of education together - on campus + off campus reliable
The most detailed and comprehensive update content and all functions of guitar pro 8.0
Biscuits (examination version)
Summary of redis AOF and RDB knowledge points