python并发编程:IO模型

一 IO模型

二 network IO

再说一下IO发生时涉及的对象和步骤。对于一个network IO (这里我们以read举例),它会涉及到两个系统对象,一个是调用这个IO的process (or thread),另一个就是系统内核(kernel)。当一个read操作发生时,该操作会经历两个阶段:

1)等待数据准备 (Waiting for the data to be ready)
2)将数据从内核拷贝到进程中(Copying the data from the kernel to the process)

  这两点很重要,因为这些io模型的区别就是在两个阶段上各有不同的情况

原文地址:https://www.cnblogs.com/mike-liu/p/9301848.html