Filter: C++  Pascal  C#  VB.NET  Java  Java ME  ActiveX  DLL 


InetTransport     See also    

Defines the size of the thread pool.


    void setThreadPoolSize(unsigned long Value);
    unsigned long getThreadPoolSize(void);

    property ThreadPoolSize : cardinal;

    Property ThreadPoolSize As Long

    HRESULT _stdcall ThreadPoolSize([in] unsigned long Value );
    HRESULT _stdcall ThreadPoolSize([out, retval] unsigned long * Value );

    public int ThreadPoolSize;

    Public Property ThreadPoolSize As Integer

    public void setThreadPoolSize(int value);
    public int getThreadPoolSize();

[Java ME]
    public void setThreadPoolSize(int value);
    public int getThreadPoolSize();

    void __stdcall IPCInetTransportSetThreadPoolSize(HIPCInetTransport h, unsigned long value);
    unsigned long __stdcall IPCInetTransportGetThreadPoolSize(HIPCInetTransport h);


  • h - handle to the object that was returned by Create method


    Use ThreadPoolSize to define the thread pool size. Thread pool is a list of threads that are created when the transport is activated and kept in reserve. When the transport needs a thread to handle TCP connection, it takes an available thread from the pool. When the thread is no longer needed, it is returned to the pool. As you know, thread creation and disposal is a time-consuming operation, so thread pool lets you speed up operations. If there are no available threads in the pool, new thread is created instead of taking it from the pool. When the pool is empty, unused thread is not placed to the queue, but disposed of instead. Set the property to 0 to prevent creation fo pooled threads. When the value is 0, the threads are allocated and deallocated when needed.
    Use thread pool when the number of expected connections is estimated to change not significantly and to be greater than 0. If the connections are occasional, use of thread pool will only consume system resources without giving any benefits.