This topic has not yet been rated - Rate this topic

StartThreadpoolIo function

Applies to: desktop apps only

Notifies the thread pool that I/O operations may possibly begin for the specified I/O completion object. A worker thread calls the I/O completion object's callback function after the operation completes on the file handle bound to this object.

Syntax

VOID WINAPI StartThreadpoolIo(
  __inout  PTP_IO pio
);

Parameters

pio [in, out]

A TP_IO structure that defines the I/O completion object. The CreateThreadpoolIo function returns this structure.

Return value

This function does not return a value.

Remarks

You must call this function before initiating each asynchronous I/O operation on the file handle bound to the I/O completion object. Failure to do so will cause the thread pool to ignore an I/O operation when it completes and will cause memory corruption.

If the I/O operation fails, call the CancelThreadpoolIo function to cancel this notification.

If the file handle bound to the I/O completion object has the notification mode FILE_SKIP_COMPLETION_PORT_ON_SUCCESS and an asynchronous I/O operation returns immediately with success, the object's I/O completion callback function is not called and threadpool I/O notifications must be canceled. For more information, see CancelThreadpoolIo.

To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or higher.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

WinBase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

CancelThreadpoolIo
CloseThreadpoolIo
CreateThreadpoolIo
Thread Pools
WaitForThreadpoolIoCallbacks

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ