home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / winbase / io / winnt / unbufcpy / readme.txt < prev    next >
Text File  |  1996-01-17  |  1KB  |  27 lines

  1. Fast Copy Routines
  2.  
  3.  
  4. The UNBUFCPY sample consists of two parts: UNBUFCP1 and UNBUFCP2.
  5.  
  6. The UNBUFCP1 sample shows a fast copy routine that uses I/O completion 
  7. ports. It is intended to demonstrate using a single thread to complete I/O 
  8. requests from multiple file handles.
  9.  
  10. Only one thread and one I/O completion port is used. The file handles for 
  11. the source and destination files are both associated with the same port. The 
  12. thread starts by posting a number of overlapped reads from the source file. 
  13. It then waits on the I/O completion port. Whenever a read completes, it 
  14. immediately turns it into a write to the destination file. Whenever a write 
  15. completes, it immediately posts the next read from the source file.
  16.  
  17. The UNBUFCP2 sample shows a fast copy routine that uses I/O completion 
  18. ports. It is intended to demonstrate how to complete I/O in a different 
  19. thread than the thread that started the I/O.
  20.  
  21. Two threads are used. The first thread posts overlapped reads from the 
  22. source file. These reads complete to an I/O completion port the second 
  23. thread is waiting on. The second thread sees the I/O completion and posts 
  24. an overlapped write to the destination file. The write completes to another I/O completion 
  25. port that the first thread is waiting on. The first thread sees the I/O 
  26. completion and posts another overlapped read.
  27.