UnBufCpy
所属分类:文件操作
开发工具:WINDOWS
文件大小:15KB
下载次数:61
上传日期:2004-12-18 16:42:45
上 传 者:
llemmx
说明: 经典的IOCP文件读写代码
(classic IOCP document literacy code)
文件列表:
UnBufCpy (0, 2004-12-18)
UnBufCpy\Makefile (916, 2004-12-08)
UnBufCpy\Makefile1.opt (48640, 2004-12-08)
UnBufCpy\Makefile1.plg (1371, 2004-12-08)
UnBufCpy\UnBufCp1.c (17360, 2004-12-08)
UnBufCpy\UnBufCp2.c (19073, 2004-12-08)
Fast Copy Routines
The UNBUFCPY sample consists of two parts: UNBUFCP1 and UNBUFCP2.
The UNBUFCP1 sample shows a fast copy routine that uses I/O completion
ports. It is intended to demonstrate using a single thread to complete I/O
requests from multiple file handles.
Only one thread and one I/O completion port is used. The file handles for
the source and destination files are both associated with the same port. The
thread starts by posting a number of overlapped reads from the source file.
It then waits on the I/O completion port. Whenever a read completes, it
immediately turns it into a write to the destination file. Whenever a write
completes, it immediately posts the next read from the source file.
The UNBUFCP2 sample shows a fast copy routine that uses I/O completion
ports. It is intended to demonstrate how to complete I/O in a different
thread than the thread that started the I/O.
Two threads are used. The first thread posts overlapped reads from the
source file. These reads complete to an I/O completion port the second
thread is waiting on. The second thread sees the I/O completion and posts
an overlapped write to the destination file. The write completes to another
I/O completion port that the first thread is waiting on. The first thread
sees the I/O completion and posts another overlapped read.
近期下载者:
相关文件:
收藏者: