Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

OW32::CIoCompletionThreadPool Class Reference

A pool of IOCP worker threads. More...

#include <IoCompletionThreadPool.h>

List of all members.

Public Member Functions

 CIoCompletionThreadPool (HANDLE hExistingCompletionPort=NULL, bool fCloseCompletionPort=false)
 Construct a pool of io completion worker threads.
BOOL Create (DWORD threads, DWORD concurrentThreads=0, int priority=THREAD_PRIORITY_NORMAL)
 Called to create the threads in the pool.
BOOL Destroy ()
 Called to terminate the worker thread pool.
 operator HANDLE () const
 HANDLE extract for the io completion port this pool is for.
HANDLE GetCompletionPort () const
 Return the io completion port this pool is using.
void SetCompletionPort (HANDLE hCompletionPort, bool fCloseCompletionPort=false)
 Set the io completion port this pool is using.


Detailed Description

A pool of IOCP worker threads.


Constructor & Destructor Documentation

OW32::CIoCompletionThreadPool::CIoCompletionThreadPool HANDLE  hExistingCompletionPort = NULL,
bool  fCloseCompletionPort = false
[inline]
 

Construct a pool of io completion worker threads.

Parameters:
hExistingCompletionPort Handle of an existing io completion port to handle notifications for
fCloseCompletionPort flag set if we should close the given io completion port on Destroy().


Member Function Documentation

BOOL OW32::CIoCompletionThreadPool::Create DWORD  threads,
DWORD  concurrentThreads = 0,
int  priority = THREAD_PRIORITY_NORMAL
 

Called to create the threads in the pool.

Parameters:
priority Priority for the IOCP threads
threads Number of threads to create.
concurrentThreads Number of threads to run concurrently from the io completion port.
Returns:
TRUE if successful, FALSE otherwise.

BOOL OW32::CIoCompletionThreadPool::Destroy  ) 
 

Called to terminate the worker thread pool.

Returns:
TRUE if successful, FALSE otherwise.

HANDLE OW32::CIoCompletionThreadPool::GetCompletionPort  )  const [inline]
 

Return the io completion port this pool is using.

Returns:
The io completion port, if any

void OW32::CIoCompletionThreadPool::SetCompletionPort HANDLE  hCompletionPort,
bool  fCloseCompletionPort = false
[inline]
 

Set the io completion port this pool is using.

Parameters:
hCompletionPort the new completion port handle
fCloseCompletion port - flag set if we should close the completion port on Destroy
You should call this BEFORE create() if an IOCP was not supplied to the c'tor. Any existing completion port will be discarded, but not closed.


The documentation for this class was generated from the following file:
Generated on Sun Jun 5 01:29:24 2005 for OW32 by  doxygen 1.3.9.1