Discuss this help topic in MsgConnect Forum

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



InetTransport.ThreadPoolSize

InetTransport     See also    


Defines the size of the thread pool.

Declaration

[C++]
    void setThreadPoolSize(unsigned long Value);
    unsigned long getThreadPoolSize(void);

[Pascal]
    property ThreadPoolSize : cardinal;

[VB6]
    Property ThreadPoolSize As Long

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

[C#]
    public int ThreadPoolSize;

[VB.NET]
    Public Property ThreadPoolSize As Integer

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

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

[DLL]
    void __stdcall MCInetTransportSetThreadPoolSize(HMCInetTransport h, unsigned long value);
    unsigned long __stdcall MCInetTransportGetThreadPoolSize(HMCInetTransport h);

Parameters

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

Description

    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.

Discuss this help topic in MsgConnect Forum