File tree 1 file changed +3
-3
lines changed
docs/high-performance/message-queue
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -401,7 +401,7 @@ emmm,就两个字—— **幂等** 。在编程中一个*幂等* 操作的特
401
401
402
402
### 传统IO方式
403
403
404
- ![ 3] (C:\Users\lv jiang er hao\Desktop\图库\3 .png)
404
+ ![ 3] ( https://img1.imgtp.com/2023/08/15/9DQUZuL7 .png)
405
405
406
406
传统的IO读写其实就是read + write的操作,整个过程会分为如下几步
407
407
@@ -424,7 +424,7 @@ mmap(memory map)是一种内存映射文件的方法,即将一个文件或
424
424
425
425
简单地说就是内核缓冲区和应用缓冲区共享,从而减少了从读缓冲区到用户缓冲区的一次CPU拷贝。基于此上述架构图可变为:
426
426
427
- ![ 4] (C:\Users\lv jiang er hao\Desktop\图库\4 .png)
427
+ ![ 4] ( https://img1.imgtp.com/2023/08/15/CHmGd0II .png)
428
428
429
429
基于mmap IO读写其实就变成mmap + write的操作,也就是用mmap替代传统IO中的read操作。
430
430
@@ -441,7 +441,7 @@ MappedByteBuffer mappedByteBuffer = fileChannel.map(FileChannel.MapMode.READ_WRI
441
441
442
442
sendfile()跟mmap()一样,也会减少一次CPU拷贝,但是它同时也会减少两次上下文切换。
443
443
444
- ![ 5] (C:\Users\lv jiang er hao\Desktop\图库\5 .png)
444
+ ![ 5] ( https://img1.imgtp.com/2023/08/15/jqLgCEBY .png)
445
445
446
446
447
447
You can’t perform that action at this time.
0 commit comments