I/O Completion Port 资料
C++ / C#
?
与设备通信的两种方式:
同步: 当调用 ReadFile 时, 函数会等待系统执行完所要求的操作, 才返回。
异步: ReadFile 这类函数会直接返回, 系统自己去完成对设备的操作, 然后以某种方式通知完成操作。
?
重叠 I/O
?
I/O completion ports 提供了一个有效的线程模型用于处理多个异步的 I/O 请求在多处理器系统上。
?
同步与异步的区别:
同步: 干完一件事, 再干另外一件事。
异步: 同时干多件事。
?
I/O completion ports = IOCP
?
IOCP are the way in which an app uses a pool of threads to process asynchronous I/O requests. These threads are kernel threads and their only job in life is to process I/O requests. Applications that process many concurrent asynchronous I/O requests can do more quickly and efficiently by using IOCP than by creating threads at the time of the I/O request. When you create a completion port, you can specify a concurrency value which limits the #threads associated with the port. Typically this number = #processors.