q8164305
V2EX  ›  问与答

为什么说异步 io 快

  •  
  •   q8164305 · May 23, 2018 · 3048 views
    This topic created in 2954 days ago, the information mentioned may be changed or developed.

    刚看了 io 的五种模型,其中说到只有内核复制到用户空间的才是真正的异步 io,其他都是同步 io,那么 io 的时候不需要用到 cpu 么?问题可能有点小白,求大佬解答下

    7 replies    2018-05-23 17:36:27 +08:00
    iceheart
        1
    iceheart  
       May 23, 2018 via Android
    你还没说你看到的是哪五种模型呢,这让人怎么喷啊
    PanPancf
        2
    PanPancf  
       May 23, 2018
    io 的时候不需要 CPU,io 结束时会有硬件中断通知 CPU 的
    seaswalker
        3
    seaswalker  
       May 23, 2018 via iPhone
    更有效地利用 CPU 资源
    batman2010
        4
    batman2010  
       May 23, 2018
    POSIX defines these two terms as follows:
    1. A synchronous I/O operation causes the requesting process to be blocked until that I/O operation completes.
    2. An asynchronous I/O operation does not cause the requesting process to be blocked.
    cuzfinal
        5
    cuzfinal  
       May 23, 2018
    异步 IO 不卡啊,谁说异步 IO 快了。
    0x8C
        6
    0x8C  
       May 23, 2018
    1.要看应用场景
    2.得看你对快的定义
    verrickt
        7
    verrickt  
       May 23, 2018 via Android
    2l 说到点上了。
    这是我以前学习异步时候看过的一片博客,虽然是讲 C#的,但是基本原理是相通的
    https://blog.stephencleary.com/2013/11/there-is-no-thread.html
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4564 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 76ms · UTC 10:00 · PVG 18:00 · LAX 03:00 · JFK 06:00
    ♥ Do have faith in what you're doing.