下面是一些線程池的API,分別是適用於vista和以前的OS版本。
Feature |
Original API(XP) |
Current API |
Synch |
RegisterWaitForSingleObject UnregisterWaitEx |
CloseThreadpoolWait CreateThreadpoolWait SetThreadpoolWait WaitForThreadpoolWaitCallbacks |
Work |
QueueUserWorkItem |
CloseThreadpoolWork CreateThreadpoolWork SubmitThreadpoolWork TrySubmitThreadpoolCallback WaitForThreadpoolWorkCallbacks |
Timer |
CreateTimerQueue CreateTimerQueueTimer ChangeTimerQueueTimer DeleteTimerQueueTimer DeleteTimerQueueEx |
CloseThreadpoolTimer CreateThreadpoolTimer IsThreadpoolTimerSet SetThreadpoolTimer WaitForThreadpoolTimerCallbacks |
I/O |
BindIoCompletionCallback |
CancelThreadpoolIo CloseThreadpoolIo CreateThreadpoolIo StartThreadpoolIo WaitForThreadpoolIoCallbacks |
Clean-up group |
|
CloseThreadpoolCleanupGroup CloseThreadpoolCleanupGroupMembers CreateThreadpoolCleanupGroup |
Pool |
|
CloseThreadpool CreateThreadpool SetThreadpoolThreadMaximum SetThreadpoolThreadMinimum |
Callback environment |
|
DestroyThreadpoolEnvironment InitializeThreadpoolEnvironment SetThreadpoolCallbackCleanupGroup SetThreadpoolCallbackLibrary SetThreadpoolCallbackPool SetThreadpoolCallbackRunsLong |
Callback |
|
CallbackMayRunLong |
Callback clean up |
|
DisassociateCurrentThreadFromCallback FreeLibraryWhenCallbackReturns LeaveCriticalSectionWhenCallbackReturns ReleaseMutexWhenCallbackReturns ReleaseSemaphoreWhenCallbackReturns SetEventWhenCallbackReturns |