?????????? i/o ????? ?? Windows NT, Windows 2000 ?? Windows XP ?? ??? ??? ????????? ????? ???? ??

???? ?????? ???? ??????
???? ID: 156932 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
??? ?? ??????? ???? | ??? ?? ??????? ????

?? ????? ??

??????

Microsoft Windows NT, Windows 2000 ?? Windows XP ?? ????? i/o ????????? ?? ?????????? ?? ???? ???? I/o ?? ??? ???????? ??????? ????????? ??: ?? i/o ??????? ??? ???? ??, ?? i/o ????? ???? ?? ???? ??? ?????????? i/o, ????? ???, ????? ???????? ???? ?? ???? ???? ?? ??? ?? i/o ??????? ???? ??, ????? i/o ?????? ??? ??? ??? ?? ???? ???? ?? ???? ?? ??? ???? ???? ???? ??? I/o ????? ???? ?? ??? ???? ???? ???????? ?????? ????? ???? ??? ???????? ??? ??, ???? ?????? ???????? i/o ???????? ?? ???? ???????? ?????? ?? ????? ???? ????????? ?? ???? ????

?????????? i/o ?? ??? ?? ?? ??? ???? ???? ???? ???? ?? ??? ??? ?? ??? ?? i/o ???????? ????? ???? ?? ??? ??, ???? ???? ?????? ???? ??? , ?? Overlapped i/o ????? ????? ?? ??? ?????????? i/o ?? ???-overlapped ???? ?? ????????? i/o ?? ??? i/o. ?? ???? Asynchronous ?????? ?? ????? ???? ?? ?? ????????? Windows NT ?? ??????? i/o ???????? ?? ???? ?? ???? ????? ?? ???? CreateFile ???? ????? i/o ??????? ?? ??? ??? ??????? ??, ReadFile, WriteFile.

?????, ?????????? i/o ???????? ???? ????????? i/o. ?? ??? ??? ??? ??????? i/o ????????? ?? ?? ???? ??? ??? ??? ??? ?? ????? ???? ?? ????? ?????? ?????????? ??? ?????? ??? ???? ???? ??? ????????? ?? ??? ??? ?? i/o ??????? i/o ????? ???? ?? ???? ???? ??????? ????? ???? ????

?? ??????? i/o ????????? ?? ?????????? ?????? ???? ?? ??? ??????? ???? ?? ???? ReadFile ?? WriteFile ?????? ?? ??? ??? ????? ???? ??; ????? ?????? ReadFileEx ?? WriteFileEx ?? ???? ??? ?????? ?? ???? ???? ????? i/o ????? ??? ?? ????? ???? ??, ?? ?????????? ?? i/o, ???? ?????? i/o ?? i/o ??????? ?? ???? ?????? ?? ??? ???? ???? ?? ???? ???

???: ??????? Windows 95 ?????? ???? ???? ?????????? i/o ????? ?????? ?? ?????? (????? ???? ?????? ?? ??/? ?????? ?? ??), ???? ??????? ??? ?? ???? ??? ????? ???? ???

???? ???????

??? ?????????? i/o ??? ????

FILE_FLAG_OVERLAPPED ???? ??? CreateFile ????????? ???? ???? ????? ?? ????? ???? ??? ?? ???? ?? ??????????? ??? ??? ???? ?? ???? ?? ??? ????? i/o ???????? ?? ?????? ???? ??? ???? ?? ?????? ??:
   HANDLE hFile;

   hFile = CreateFile(szFileName,
                      GENERIC_READ,
                      0,
                      NULL,
                      OPEN_EXISTING,
                      FILE_FLAG_NORMAL | FILE_FLAG_OVERLAPPED,
                      NULL);

   if (hFile == INVALID_HANDLE_VALUE)
      ErrorOpeningFile();
				
?? ?????? ???????? ???? ?? ??????? ?????????? i/o ?? ??? ?????? ??????? ???? ?? ???? ?? ???????? ??, ?? ??? ???????? ????????? ????? ?? ??? ???? ?? ??? ?????????? ??? ?? ??????????? ??? ??? ???? ???? ?? ???? ?? ?? i/o ???????? ?? ??? ??? ?? ????? ???? ?? ??? ????????? ????? ???, ?? ?????, ???? ????? ??? ????? ??? ????????? ???? ?? ?? ?? ????? ???

???? ??? ??? ?? ????? ????????? ?? ???? ??? ?? ?? ?? ??? ?????????? ????????? ???????? ?????, ?????????? ???????? ???????? ???? ????, ?? ?? ???? ?? ??? ????????? ?????? ?????? ?? ???, ????? ??? ??? ????? ?? ??????? ?? ?? ???????? ?? ???-overlapped ????? ??? ???????? ?? ??? ?? ???? ?? ??? ???? ?? ???? ????????? i/o ????? ???? ?? ??? ???????? ?????? ?? ???:
   if (!ReadFile(hFile,
                 pDataBuf,
                 dwSizeOfBuffer,
                 &NumberOfBytesRead,
                 &osReadOperation )
   {
      if (GetLastError() != ERROR_IO_PENDING)
      {
         // Some other error occurred while reading the file.
         ErrorReadingFile();
         ExitProcess(0);
      }
      else
         // Operation has been queued and
         // will complete in the future.
         fOverlapped = TRUE;
   }
   else
      // Operation has completed immediately.
      fOverlapped = FALSE;

   if (fOverlapped)
   {
      // Wait for the operation to complete before continuing.
      // You could do some background work if you wanted to.
      if (GetOverlappedResult( hFile,
                               &osReadOperation,
                               &NumberOfBytesTransferred,
                               TRUE))
         ReadHasCompleted(NumberOfBytesTransferred);
      else
         // Operation has completed, but it failed.
         ErrorReadingFile();
   }
   else
      ReadHasCompleted(NumberOfBytesRead);
				
??? ???? ?? & NumberOfBytesRead ReadFile ??? ??? ???? ??? ?? ??? ?? & NumberOfBytesTransferred GetOverlappedResult ??? ???? ??? ??? ??? ??? ???????? GetOverlappedResult ?? ???????? ???? ?? ??? ????? ???? ???? ??, ?? ??????????, ???? ??? ?? ?? ?? ?? ??? ???????? ??? ??????????? ?????? ?? ???????? ?????? ?????? & NumberOfBytesRead ReadFile ??? ???? ??? ??, meaningless.

????? ???, ?? ???????? ?????, ???? ???? ???? ???, & NumberOfBytesRead ??? ReadFile ??? ???? ?????? ?? ?????? ?? ??? ????? ??? ?? ?????? ???, ??? ??? ReadFile OVERLAPPED ?????? ?? ????? ? ???; ??? GetOverlappedResult ?? WaitForSingleObject ?? ??? ? ?????

???? caveat ?????????? ???????? ?? ??? ???? ????? ????????? ????? ?? ???? ??, ?? ?? ??? OVERLAPPED ?????? ?? ?? ?? ????? ???? ?????? ???? ??? ????? ??? ??? ???? ??? ??? ???????? i/o ????????, ????, ?? ??? OVERLAPPED ?????? ????? ???? ?????? ?? ???? OVERLAPPED ?????? ?? ???: ????? ???? ???, ?? i/o ???????? ??? ????????? ?????? ??????? ??????, ?? ?? ???? ????? ????? ?? ???? ??? ????? ??? ????-??? ???? ?? ???????? ?? ???????? ???? ???? ??? ??, ???? ???? ?? ?? ???? ??? ??? OVERLAPPED ?????? ?? ????? ?? ???? ???, ?? ???: ????? ???????? ?? ????? ???? ?? ??? ?? ??? ????? ???? ?? ????, ?? ??? ????? ?? ??? ??????? ???? ???????

??? ????? ?? ??? ???? ???? ?? ??? ???????? ?? ?? ?? ?????? ???? ???? ?? ?? ????????? ???? ???? ???? ?????? ???? ???? ?? ????? ?? ?? ???? ???? ??????? i/o ???????? ????? ?? ???? ??; ????? ?? ???? ????? ????????? ?? ????? ???? ?? ???? ???

?????????? i/o ?? Synchronous ???? ?? ??? ?????

?? ???? ?? ???? ??? ??? ?? ????????? ?? ?????? ???? ???, ?? ???????, ???? ??? i/o ???????? ?????????? ??? ?? ?????????? ??? ???? ???? ???, ?? ???? ??? ????? ?? ???? ??? ?? ReadFile ???????? FALSE GetLastError() ?? ??? ERROR_IO_PENDING ?? ??? ??, ???? ???? ?? ?? ???? ?? ????????? ????? ?? ??? ??? ??? ??? ?? ????? ???? ???

?? ?????? ?? ????? ?????????? ??? i/o ???????? ????? ???? ??? ??? ?? ?????????? ???????? ?? ??? coded ??? ?? ??:

???????

?? obstruction ?????????? ???????? ?? ??? NTFS ??????? ??? ????? ?????? ??????? ??????? ???????? ??????????? ??? ??? ????? ????? ????; ???? ???? ??? ???????? ???? ????????? ??? ???? ???? ??????? ?? ??? ???? ???? ???? ?? ???????? ???? ?? PKZIP ?? ???? ?????????? ?? ??? ?????????

NTFS ???????????

??????? ?? ????, ????? ??????????? ?????? ??????? ?????????? i/o ????????? ???? ?? ??? ?????? ???? ?? ??? ???? ??? ??? ??????? ????????? ?? ???? ???, ?? i/o ???????? ?????????? ???? ??????

??? ????? ??????? ???? ?? ???

?? ????? ???? ?? ?? i/o ???????? ????? ?????????? ??? ????? ???????? ??? Windows NT ?? ??? ?? ???? ????? ?? ?????? ?? ?? ???? ????? ?? ??? ???????? ????????? ???? ????? ??????

???: ????????? ?? ???? ??? ????? ???? ????? ??? ???? ???????? ?????????? SetFileValidData ??????? ?? ????? ??, ?? ???? ??? ?? WriteFile ???? ?? ????? ?? ????? ???? ????? ????????? ???? ???

SetFileValidData (?? Windows XP ?? ??? ?? ????????? ?? ?????? ??) ?? ????? ??, ????????? ?????? ?? ??????? ?????-?????? ??????? ?? ??? ?? ???????? ???????? incurring ?? ???? ??? ???? ????

??????? NTFS ????? ?????? ???? ?????-??? ???? SetFileValidData ?????? ???????? ???? ???? ?? ?? ????? ???? ????? (VDL) ??, ?? ??????? ?? ??????? ???????? ????????? ???? ??????? ?????? ???? ???? ??? ?? ????? ???? ????? ?? ???? ???? ?? ???????? ?? ?????, SetFileValidData ???? ?? ??? SeManageVolumePrivilege ????? ?? (???????? ??? ??, ?? ???? ?? ??? ???? ?????????? ????????? ??)? Microsoft ??????? ???? ?? ?? ISVs ????????????? ?? ???????? ?? ??????? ?? ????? ???? ?? ??????

???

??????? i/o ??????? (?????, ????? ?? ????), ?? i/o ?????? ????? "?????" ?? ???? ???, ??? ???????? ????? ?? ????? ?? ReadFile ?? WriteFile ??????? TRUE ???? ????? ????? ??? ??? ??? ??? ?????? ??, ?? ???????? ?? ???????? ????????? ???? ?? ???? ?? ??? ????? ???? ???? ????? ?? ??? ??????, "?? ???? ??? ?????? ??? ?? ?????" ?? ??? ??, ?? i/o ?????? ????? ?? ???? ????

???? ??? ??? ???? ??

???? ??? ???? ??, ?? ??? ????? ?? ?? ??????? ??? ??, ??? ?? ???? ??? ??? ??? Windows NT ??? ????? ?????? ?? ????? ???? ??? ?????? ??? ?? ???? ???? ??? ??? ?????? ??????? Windows NT ??? ??? ?????????? ????? ?????? ???? ???? ?? ??? ??????? ??? ??????? ?????? ????? ???? ??? ????? ?????? ?? ??????? ?? ???? , ??? ??????? ?? ???? ??? ???????, ?????? ?? ???????? ????? ?????? ??? ?? ????? ????? ??? ?????????? ??? ?? ?? ????? ??????, ?? ????? ?????? ??? ???? ???, ?? ????? ?????? ??????? ?? ?? ???? ????? ??????? ???? ????? ?? ????? ????? ?? ?? ????? ??? ?????? ?????? ????? ???? ????? ??? ???????? ???? ReadFile ??? ??? ?? ????? ????? ?? ??? ???? ????????? ?? ??? ???? ???? ???

?? ?? ?????? ?? ?? ???? ?????? ?? ??? ??? ????? ????? ????? ??? ??, ??????? ???? (??? ??? ?????? 16 MB ??), ?? ????? ??? ?? ??? ?????? ???? ????? ??????? ?? ??? ?? ????? ??? ??? ?????????? ?? ?? ?????? ???? ??? ??? ???? ?? ?? ???? ?? ??? i/o ???????? ?? ?????, ??? ??????? ?? ?????? ??????? ??????? ?? ?? ???? ???????? ????????? ??? ???? ????

???????? ??? ??????? ?? ??????? ?? ?? ???? ?? ?? ???? ???? ?? ???? ??? ?? ????? ??????? ?? ????????? ??? ?? ?????? ??? ?? ??? ??? ??? ??? ??????? ??? ??????? ??????? ?? ???????? FILE_FLAG_SEQUENTIAL_SCAN ???? CreateFile ??? ?? ?????? ?? ????? ?? ??? ??? ??? ?????? ????? ???????, ?? ???? ????? ????? ??? ??????? ?? ????? ??, ?? ?? ????? ???? FILE_FLAG_RANDOM_ACCESS ???? ??? CreateFile ???? ?? ??? ??? ??????? ?? ???? ?? ??? ????? ????? ?? ??? ???? ??????? ?????????? ?????

??? ?? ????? ? ????

FILE_FLAG_NO_BUFFERING ???? ?? ?? ??????? ?? ???????? ?????? ?????????? ???????? ?? ??? ????? ?????? ??? ?? ????????? ???? ?? ??? ???? ????? ????? ?? i/o ???????? ?????????? ?????? ??? ???? ???? ????? ?????? ???? ????? ???? ?? ??? ???? ?? ??????? ??? ????

???????: ???? ???? ?????? ?? ?????? ???? ?????? ?? ??? ???? ???? ?? ??? ?? ???? ?? ????? ???? ?? ??? ??? ???????? ???? ??????? ?????? ??? ?? ???? ??? ??? ?? ????? ?? ???? ??? ???? ??????? ?? ??? CreateFile ??????? ?? ??? ????????? ??????

???????? ?????? ??????? ??????

????? ????? ??? ?? ??? ??????? ?????? ???? Magnitude ?? ?????? ???? ?????????? ???? ?? ?? ???????? ?? ??? ???????? ??, ????? ???? ??, ????? ???????? ?? ????? ??-????? ?? ??? illuminates ?? ????? ??????? ?????? ?? ???????? ?? ?????

?? ????? ?? ???? ?????? ????? ?? ??? ??????? ?? ???? ???:
  • ??????? 1
    Asynchronous, unbuffered I/O:  asynchio /f*.dat /n
    
       Operations completed out of the order in which they were requested.
       500 requests queued in 0.224264 seconds.
       500 requests completed in 4.982481 seconds.
    						
    ?? ??????? ????????? ???? ?? ?? ???? ????? ??? ????????? 500 i/o ?????? ??????? ?? ???? ???? ???, ?? ???? ????? ???? ???, ?? ???? ?????? ????? ???? ?? ??? ??? ?? ?? ???? ?? ???
  • ??????? 2
    Synchronous, unbuffered I/O: asynchio /f*.dat /s /n
    
       Operations completed in the order issued.
       500 requests queued and completed in 4.495806 seconds.
    						
    ????????? ???? ?? ?? ??????? ?? ?? ????????? 4.495880 ????? ???? ???? ??? ?? ???? ??????????? ????? ???? ?? ??? ReadFile ?? ??? ???? ???, ???? 1 ??????? ???? 0.224264 ?? ?????? ????? ???? ?? ??? ????? ???? ???? ??? ??? 2 ??????? ???, ???? ?? ????????? ???? ?? ??? ????????? ?? ??? ??? "????????" ??? ?? ????? ???? ????
  • ??????? 3
    Asynchronous, buffered I/O: asynchio /f*.dat
    
       Operations completed in the order issued.
       500 requests issued and completed in 0.251670 seconds.
    						
    ?? ??????? ????????? ???? ?? ?? ??? ?? ????????? ???????? ??? ????? ?? ???? ??? ?? ?? ?? 0.251670 ????? ??? ????? ?? ???? ??? ????? ?????? ???, ?????????? ??? ?????????? ?????? ????? ?? ???? ??? ??? ?? ?? ???? ????????? ???? ?? ?? ???? ??? ??? ??????? ?? ???? ??????????? ?? ??? ???
  • 4 ???????
    Synchronous, buffered I/O: asynchio /f*.dat /s
    
       Operations completed in the order issued.
       500 requests and completed in 0.217011 seconds.
    						
    ?? ??????? ????????? ???? ?? ?? ?? ?? ?????? ??? ??????? 3? ????? ??? ?? ??? ?? ????????? ????? ?? ????? ???? ?????????? ????? ?? ?? ??? ?? ????? ????????? ???? ?? ?? ??? ??? ???? ??, ?? ?? ??????? ?? ??? ??????? ?? ???? ??????????? ???

????????

?? ??? ?? ???? ???? ????? ?? ??????? ?? ??? ??????, ????, ?? ???? ????????? ????????? ???? ?? ?? ???????? ?? ?????? ?? ?????? ???? ?? ?? ?? ???? ????

CreateFile ???? ?? ??? ??? ????? ????? ????????? ??? ???? ???????? ????? ????? ????????? ?? ??? ?? ?? ???????? ???

???: ????? ?????? ??????? predictive ?????????? ?????-???? ?? ?????????? lazy ???? ?? ???? ??????? ???? ??, ??????? ?? ??? ???????? ?????????? ??????? ?? ??? ??? ???????? ??????? ?? ????????? [ASCII 146] s i/o ?????????? ??? ???? ??, ?? ???? ?????? ??????????? ?? ??????? ?? ??? ????? ?????? ???

????? ???, ???? ????????? ???? ???? ??, ??, ???? ???? ??? ???? ?? ??? profiling ?? ??????? ?????? ????????? ???? ?? ??? ??????????? ???????, ?? ???? ??? ???? illustrated ??????? ???? ?? ??? ???? ??? ?????? ??? profiling ??? ?? ??? ???? ???? ?? ??? ???? ??? ?? ?? ????? ?? ReadFile ?? WriteFile ??????? ???? ???? ???? ?? ??? ???????? i/o ???????? ?? ??? ??? ?????? ??? ?? ??????? ?? ???? i/o ?????? ???? ?? ??? ?? ?? ??? ?????? ??? i / o, ???? ??? ?????? ????? ?????????? ???? ???????, ??? ????????? i/o ?????? ??? ???? ???? ??? ?? ?????????? ???? ??? ?? ?? ???? ?? ??? i/o ???????? ?? ??? ?? takes ????? ????? ??? ???? ?????? ??????????? ??? ??? ???? ?? ??? ??? ????? ???? ?? ???? ??? ?????? ??? ????? ??? ???? ?? ??? QueryPerformanceCounter ??????? ?? ????? ???? ?? ?????? profiling.

???????? ????????? ?????? ?? ???? ???? ????????? ?? ????????? ??? ?? ???? ??? ????? ?? ??? ?? ????? ??? ??? ?? ??????????? ?????? ?? ??? ???????? ??? ???????? ??? ??????? ?? ??????????? ????? ????? ?? ??? ????? ????? ?? ??????? ????? ??????????? ?????? ???????? ???????? ????? ?????? ?? ??????????? ?? ????? ??????

???????? ????????? ??? ?????? ?? ?????????? ???; ??????????? ?? DiskPerf ????? ??? ?? ?????? ???? ????? ?????? ?? ??????????? ?? ???? ??????? ???? ?? ??? ?????? ?? ???, ???? ???? diskperf -y ???? ????? ???? ????? ???? ???? ???? ?? ???, ?? ???? ?????? ??????? ???? ?? ??? ?????? ???????? ???? ?????? ???

??????

?? ?????????? ?? ??????????? ??????? ?? ???? ??? ???? ??????? ?? ???, ??????? "Optimizing Windows NT" Windows NT ?????? ??? ????? ??? ?? ????????? ???
SQL ?????, ?????? 'guaranteed ????? ????? ??????' ?? ??? ??? Microsoft SQL Server Always-On ??????? ?????? ??????? ????????? ?? ??? ??? ?????? ???? ?? ??? ?????? ??? FoSQL Server ??????? ????? ?? ????? ?? ?????? ?????????? ?? ???? ??? ???? ??????? ?? ??? Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ????? ????:
967576Microsoft SQL Server ??????? ????? ?????/?????? ??????????

???

???? ID: 156932 - ????? ???????: 30 ?? 2013 - ??????: 5.0
???? ???? ???? ??:
  • Microsoft Win32 Application Programming Interface
  • Microsoft SQL Server 2008 Developer
  • Microsoft SQL Server 2008 Enterprise
  • Microsoft SQL Server 2008 Express
  • Microsoft SQL Server 2008 Standard
??????: 
kbapi kbfileio kbinfo kbkernbase kbmt KB156932 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:156932

??????????? ???

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com