mirror of
https://github.com/Aexiar/c.git
synced 2024-10-22 14:05:45 +02:00
c
This commit is contained in:
parent
d0bb9b020f
commit
68381eaae0
4
docs/notes/01_c-basic/07_xdx/assets/10.svg
Normal file
4
docs/notes/01_c-basic/07_xdx/assets/10.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 216 KiB |
4
docs/notes/01_c-basic/07_xdx/assets/5.svg
Normal file
4
docs/notes/01_c-basic/07_xdx/assets/5.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Do not edit this file with editors other than draw.io -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="641px" height="61px" viewBox="-0.5 -0.5 641 61" content="<mxfile host="Electron" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.7.17 Chrome/128.0.6613.36 Electron/32.0.1 Safari/537.36" version="24.7.17" scale="1" border="0"> <diagram name="第 1 页" id="HEK4woBdrfgql7qMwJSw"> <mxGraphModel dx="1416" dy="818" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0"> <root> <mxCell id="0" /> <mxCell id="1" parent="0" /> <mxCell id="9DnvKgpYVnukXR7bQpn0-1" value="CPU" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1"> <mxGeometry x="80" y="420" width="120" height="60" as="geometry" /> </mxCell> <mxCell id="9DnvKgpYVnukXR7bQpn0-5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;flowAnimation=1;shadow=1;" edge="1" parent="1" source="9DnvKgpYVnukXR7bQpn0-2" target="9DnvKgpYVnukXR7bQpn0-1"> <mxGeometry relative="1" as="geometry" /> </mxCell> <mxCell id="9DnvKgpYVnukXR7bQpn0-2" value="内存" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1"> <mxGeometry x="330" y="420" width="120" height="60" as="geometry" /> </mxCell> <mxCell id="9DnvKgpYVnukXR7bQpn0-4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;flowAnimation=1;shadow=1;" edge="1" parent="1" source="9DnvKgpYVnukXR7bQpn0-3" target="9DnvKgpYVnukXR7bQpn0-2"> <mxGeometry relative="1" as="geometry" /> </mxCell> <mxCell id="9DnvKgpYVnukXR7bQpn0-3" value="IO 设备" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1"> <mxGeometry x="600" y="420" width="120" height="60" as="geometry" /> </mxCell> </root> </mxGraphModel> </diagram> </mxfile> " style="background-color: rgb(255, 255, 255);"><defs><style>@keyframes ge-flow-animation-_-1MwRo2DOFU8_5qbC4R {
 to {
 stroke-dashoffset: 0;
 }
}</style></defs><rect fill="#ffffff" width="100%" height="100%" x="0" y="0"/><g><g data-cell-id="0"><g data-cell-id="1"><g data-cell-id="9DnvKgpYVnukXR7bQpn0-1"><g id="cell-9DnvKgpYVnukXR7bQpn0-1"><g><rect x="0" y="0" width="120" height="60" fill="#f5f5f5" stroke="#666666" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 30px; margin-left: 1px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">CPU</div></div></div></foreignObject><image x="1" y="23.5" width="118" height="17" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdgAAABECAYAAAAiCiQVAAAAAXNSR0IArs4c6QAADBRJREFUeF7tnX+MFGcZx59n9rq9A5eT2qrVGNP0ksqZwu3O7l0AxQsIwdqWaiSCRkSx1tBqa22sBa1GayNJrUCtSdNYWw211T8aGqkWI8E2cB47M0vAHEpAW01aNEbuduH2hNt5vDfZJcNm9m5nf87sfCe5v/b98Tyf74Qv7zvvDyY8IAACIAACIAACDSfADW8RDYIACIAACIAACBAMFi8BCIAACIAACDSBAAy2CVDRJAiAAAiAAAjAYPEOgAAIgAAIgEATCMBgmwAVTYIACIAACIAADBbvAAiAAAiAAAg0gQAMtglQ0SQIgAAIgAAIwGDxDoAACIAACIBAEwjAYJsAFU0Gn0AqlXqniHxARG4hohuJaBERdRczOysiJ5j5MDPvn5ycHBkbGzvnNetUKvUh27YPeq3nKH+WmU8T0T9s2z5ARAcsy/orEdnVtJlIJBYx82+J6L2l8pqmDafT6T9WU79SGV3X5xHRk0T0KUeZZ4nodtM0J+tpG3VBIEgEYLBBUguxNpXA8PBwVzabXcXM24nogx46myKiH3V1de0aHR39V7X1GmCwbl0dZ+b7DcN4eS6jhcFWqxTKgUBtBGCwtXFDrc4iwKlUKmnb9g89Gms5hTNE9DXTNJ+by9xUxSYZbCmm3fl8fvtsI2sYbGe9xMjGfwRgsP7TBBG1kIAatZ47d26LiOx0TAGXR3CRiP5CRPniD9cQ0XUVwrwoIt/PZrM/OHXq1P9mS6XJBqu6/m4sFvvewYMHp93igMG28EVDV6EkAIMNpexIWhFQ5prL5b41M9p80IXIcSLabdv2S5lM5k0iEmcZ9Z3Rtu2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GADLyESAAEQAAEQ8CMBGKwfVUFMIAACIAACgSfwf7IwP5BPtPkkAAAAAElFTkSuQmCC"/></switch></g></g></g></g><g data-cell-id="9DnvKgpYVnukXR7bQpn0-5"><g id="cell-9DnvKgpYVnukXR7bQpn0-5"><g style="filter: drop-shadow(rgba(0, 0, 0, 0.25) 2px 3px 2px);"><path d="M 250 30 L 126.37 30" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke" stroke-dasharray="8" style="animation: 500ms linear 0s infinite normal none running ge-flow-animation-_-1MwRo2DOFU8_5qbC4R; stroke-dashoffset: 16;"/><path d="M 121.12 30 L 128.12 26.5 L 126.37 30 L 128.12 33.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/></g></g></g><g data-cell-id="9DnvKgpYVnukXR7bQpn0-2"><g id="cell-9DnvKgpYVnukXR7bQpn0-2"><g><rect x="250" y="0" width="120" height="60" fill="#f8cecc" stroke="#b85450" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 30px; margin-left: 251px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">内存</div></div></div></foreignObject><image x="251" y="23.5" width="118" height="17" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdgAAABECAYAAAAiCiQVAAAAAXNSR0IArs4c6QAACvRJREFUeF7tnWvIBUUBhl9T05AumiLiDymCisSQylCDqH5EZImQ3bQitKtKVqiVlaVEUVmhGRpJVy3R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w3uUtdCAOBogkg2KKbn8pLerqkT1Z3vj4l0PDxiF1l2BXgvtU71YNbAvvEKF/c7veyKdPCzWT7CNbxT5F01A7l+6eka8Kl7nd3rTThIFA6AQRbeg+g/hCAAAQgkIUAgs2ClUQhAAEIQKB0Agi29B5A/SEAAQhAIAsBBJsFK4lCAAIQgEDpBBBs6T2A+kMAAhCAQBYCCDYLVhKFAAQgAIHSCSDY0nsA9YcABCAAgSwEEGwWrCQKAQhAAAKlE0CwpfcA6g8BCEAAAlkIINgsWEkUAhCAAARKJ4BgS+8B1B8CEIAABLIQQLBZsJIoBCAAAQiUTgDBlt4DqD8EIAABCGQhgGCzYCVRCEAAAhAonQCCLb0HUH8IQAACEMhCAMFmwUqiEIAABCBQOgEEW3oPoP4QgAAEIJCFAILNgpVEIQABCECgdAKPAYjWHWMEtB9wAAAAAElFTkSuQmCC"/></switch></g></g></g></g><g data-cell-id="9DnvKgpYVnukXR7bQpn0-4"><g id="cell-9DnvKgpYVnukXR7bQpn0-4"><g style="filter: drop-shadow(rgba(0, 0, 0, 0.25) 2px 3px 2px);"><path d="M 520 30 L 376.37 30" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke" stroke-dasharray="8" style="animation: 500ms linear 0s infinite normal none running ge-flow-animation-_-1MwRo2DOFU8_5qbC4R; stroke-dashoffset: 16;"/><path d="M 371.12 30 L 378.12 26.5 L 376.37 30 L 378.12 33.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/></g></g></g><g data-cell-id="9DnvKgpYVnukXR7bQpn0-3"><g id="cell-9DnvKgpYVnukXR7bQpn0-3"><g><rect x="520" y="0" width="120" height="60" fill="#fff2cc" stroke="#d6b656" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 30px; margin-left: 521px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">IO 设备</div></div></div></foreignObject><image x="521" y="23.5" width="118" height="17" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdgAAABECAYAAAAiCiQVAAAAAXNSR0IArs4c6QAAEQBJREFUeF7tnQnQftUcx78Zk0F2UXYmJCKTnbFkyTaZDEX2rJXsZUkqQpKsaUFNURHJntAkW0OkxCjDhCFisiQ1Nbb7qXNnzv+6z33uuffce9/nvd8z0/Sf971n+5znfb739zu/8zsbycUETMAETMAETCA7gY2yt+gGTcAETMAETMAEZIH1h8AETMAETMAEBiBggR0Aqps0ARPYgMBNJW0u6UJJ/zEbE5gLAQvsXFba8zSBaQjwHfMiSUdJ+rakD0r6kqQrpxmOezWB8QhYYMdj7Z5MoInAdSXdUtIlkv67jlDdQ9KJku4T5vRzSc+Q9JN1NEdPxQRqCVhg/cEwgekJXF/S3pJeIGlXSWckiOwmkp4t6SYZpvF3SZ+QdHmGtmjihsW43ivpxVF7L5H00YT5ZRqKmzGB8QlYYMdn7h5NICZwc0lvk7R7+OFvEkX2FpKOl7R9BqynSXqWpEsztMV3C219PGrruKLtPSVdlqF9N2ECa56ABXbNL5EHuM4JILAHVaw8RPZ5ks5sMfe1KrCPkHSspDtGcziymNdFLebU55GfSvpynwZc1wRyEbDA5iLpdroSwMrBLVmWXFbUzSQ9pHC38kV/v7AHiJhR/iLpPEnsB9LfDybe+7x1EWWL+Dwl4tBWZKsCS6QudduWTSXdNzyci/1mwQ38pLaDyPjcW4JHIGOTbsoEuhGwwHbj5lr5COQU2OtIeqCklxUCuqOkGyUMk8jW9wWr8V8J9XI9iqV3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u6zoWyQuXRDpX6+NdKK3rPnUdRbwiH/o5DNMCO4dV9hxXgQBncTmXituaYKfybCo/Rwi5fGCHyM1dNyfOyL4ruL2X7SPT7k6F6/n1C44oxe3jRj4r7O+e3QDT52BX4ZPmMY5GwAI7Gmp3ZALJBLYI18lt21AT8SNAizO/53YI0EJo2bslArt6pCfutk3CDQts8hK7wnomYIFdz6vrua06gbrE/OWczg8XEmDtkgaxb8H9TNpJrv4jeUccgc1eLmdvL1vSSZ991D7jn6rfPmN23RkQsMDOYJE9xZUmEF9swJ4slxnwH7fl5EpxWAXEdX3bF+kVdy4imDcrjvHsWnMrTx3UqYRuqn5X+oPlwQ9PwAI7PGP3YAJ9CRDMxBlXrNar+zaWWH/jhD43KYKzeCGgkAzj8sS+uj4+Vb9dx+t6MyFggZ3JQnuaJmACJmAC4xKwwI7L272ZgAmYgAnMhIAFdiYL7WmagAmYgAmMS8ACOy5v92YCJmACJjATAhbYmSy0p2kCJmACJjAuAQvsuLzdmwmYgAmYwEwIWGBnstCepgmYgAmYwLgELLDj8nZvJmACJmACMyFggZ3JQnuaJmACJmAC4xKwwI7L272ZgAmYgAnMhIAFdiYL7WmagAmYgAmMS8ACOy5v92YCJmACJjATAhbYmSy0p2kCJmACJjAuAQvsuLzdmwmYgAmYwEwIWGBnstCepgmYgAmYwLgELLDj8nZvJmACJmACMyFggZ3JQnuaJmACJmAC4xL4H9PnmXLBsGdCAAAAAElFTkSuQmCC"/></switch></g></g></g></g></g></g></g></svg>
|
After Width: | Height: | Size: 21 KiB |
4
docs/notes/01_c-basic/07_xdx/assets/6.svg
Normal file
4
docs/notes/01_c-basic/07_xdx/assets/6.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 51 KiB |
4
docs/notes/01_c-basic/07_xdx/assets/7.svg
Normal file
4
docs/notes/01_c-basic/07_xdx/assets/7.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 70 KiB |
4
docs/notes/01_c-basic/07_xdx/assets/8.svg
Normal file
4
docs/notes/01_c-basic/07_xdx/assets/8.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 88 KiB |
4
docs/notes/01_c-basic/07_xdx/assets/9.svg
Normal file
4
docs/notes/01_c-basic/07_xdx/assets/9.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 303 KiB |
@ -86,4 +86,60 @@
|
||||
> - ① 存储器越往上速度越快,但是价格越来越贵, 越往下速度越慢,但是价格越来越便宜。
|
||||
> - ② 正是由于计算机各个部件的速度不同,容量不同,价格不同,导致了计算机系统/编程中的各种问题以及相应的解决方案。
|
||||
|
||||
* 正是由于 CPU、内存以及 IO 设备之间的速度差异,从而导致了计算机的性能瓶颈,即所谓的
|
||||
* 正是由于 CPU、内存以及 IO 设备之间的速度差异,从而导致了计算机的性能瓶颈,即所谓的`“冯·诺依曼体系结构的瓶颈”`。
|
||||
|
||||
![](./assets/5.svg)
|
||||
|
||||
* 因为 CPU 的处理速度远远快于内存和 IO 设备,导致在等待数据处理和传输的时候,CPU 大部分处于空闲状态。就是这种显著的速度差异就导致了计算机的性能瓶颈,限制了整个计算机系统的效率。
|
||||
|
||||
> [!NOTE]
|
||||
>
|
||||
> * 对于硬件的这种显著的速度差异,我们程序员是无法解决的。
|
||||
> * 但是,为了平衡三者之间的速度鸿沟,我们可以通过引入`缓冲区`技术,来降低系统的 IO 次数,降低系统的开销。
|
||||
|
||||
* 其实,在硬件上也是有`缓冲区`的,即:CPU 内部集成了缓存,将经常使用到的数据从内存中加载到缓存中。
|
||||
|
||||
> [!NOTE]
|
||||
>
|
||||
> 对于缓存和内存中数据的同步解决方案,会有各种各样的算法,如:LRU 等。
|
||||
|
||||
![](./assets/6.svg)
|
||||
|
||||
## 1.3 缓冲区
|
||||
|
||||
### 1.3.1 概述
|
||||
|
||||
* 我们所编写的程序,都是运行在内存中的,如果我们不使用缓冲区,那么其在内存中就是这样的,如下所示:
|
||||
|
||||
![](./assets/7.svg)
|
||||
|
||||
* 而缓冲区的本质就是在`内存`中开辟一块用来`临时存储数据`的`区域`,它在速度较慢的内存和 IO 设备起到了桥梁的作用,那么其在内存中就是这样的,如下所示:
|
||||
|
||||
![](./assets/8.svg)
|
||||
|
||||
> [!NOTE]
|
||||
>
|
||||
> 其实,C 语言中的 `printf` 函数和 `scanf` 函数,其内部就使用了缓冲区。
|
||||
>
|
||||
> * ① 当我们使用 `printf` 函数输出数据的时候,数据并不会立即就写出到输出设备(如:屏幕等)。而是先将其放置到 `stdout 缓冲区`中,然后在满足条件的时候,再从缓冲区中刷新到输出设备。
|
||||
> * ② 当我们使用 `scanf` 函数输入数据的时候,数据并不会立即就从输入设备中读取(如:键盘等)。而是先将其放置到 `stdin 缓冲区`中,然后在满足条件的时候,再从缓冲区中加载数据。
|
||||
|
||||
### 1.3.2 缓冲区到底如何实现系统效率的提升?
|
||||
|
||||
* 如果没有缓冲区,假设有 5 个数据,输入设备每次传递 1 个数据,CPU 必须立即接收并处理,因此有 5 次 IO 操作,每次都是逐个处理,如下所示:
|
||||
|
||||
![](./assets/9.svg)
|
||||
|
||||
* 如果存在没有缓冲区,假设有 5 个数据,输入设备每次传递 1 个数据,但它们先存储到缓冲区中。CPU 在缓冲区满时一次性处理多个数据,减少了频繁的等待,如下所示:
|
||||
|
||||
![](./assets/10.svg)
|
||||
|
||||
> [!IMPORTANT]
|
||||
>
|
||||
> 假设每次 IO 操作的时间是 1 秒,CPU 处理数据的时间也是 1 秒,那么:
|
||||
>
|
||||
> * ① 没有缓冲区的情况下,总耗时是:5 次 I/O 操作 + 5 次处理 = 10 秒,即:没有缓冲区的情况下,每次 I/O 操作和处理器的处理是交替进行的,因此总共需要 10 秒(5 次 I/O + 5 次处理)
|
||||
> * ② 使用缓冲区的情况下,总耗时是:5 次 I/O 操作 + 1 次批量处理 = 6 秒,即:使用缓冲区的情况下,I/O 操作和处理器处理是分开的,I/O 操作先全部完成,处理器一次性批量处理所有数据。因此,总耗时减少为 6 秒(5 秒传输 + 1 秒处理)。
|
||||
>
|
||||
> 使用缓冲区能够显著减少总的执行时间,因为它允许处理器批量处理数据,而不是在每次数据传递后都进行等待处理。
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user