CFx SDK Documentation  2022 SP0
Public Member Functions | List of all members
OdRxThreadPoolService Class Referenceabstract

#include <RxThreadPoolService.h>

Inheritance diagram for OdRxThreadPoolService:
OdRxModule OdRxObject

Public Member Functions

 ODRX_DECLARE_MEMBERS (OdRxThreadPoolService)
 
virtual int numCPUs () const =0
 
virtual int numPhysicalCores () const =0
 
virtual int numThreads () const =0
 
virtual int numFreeThreads () const =0
 
virtual OdApcThreadPtr newThread ()=0
 
virtual OdApcQueuePtr newSTQueue ()=0
 
virtual OdApcQueuePtr newMTQueue (unsigned nThreadAttributes=ThreadsCounter::kNoAttributes, int numThreads=0, OdUInt32 nFlags=kMtQueueNoFlags)=0
 
virtual OdApcObjectPoolPtr newObjectPool ()=0
 
virtual OdApcEventPtr newEvent ()=0
 
virtual OdApcGatewayPtr newGateway ()=0
 
virtual OdApcLoopedGatewayPtr newLoopedGateway ()=0
 
virtual void executeMainThreadAction (MainThreadFunc mtFunc, void *pArg)=0
 
virtual void registerExternalThreads (unsigned nThreads, const unsigned *aThreads, unsigned nThreadAttribs=ThreadsCounter::kNoAttributes)=0
 
virtual void unregisterExternalThreads (unsigned nThreads, const unsigned *aThreads)=0
 
virtual void externalThreadStart ()=0
 
virtual void externalThreadStop ()=0
 
virtual void setExternalMainThreadFunc (ExecuteMainThreadFunc execFunc)=0
 
virtual ExecuteMainThreadFunc getExternalMainThreadFunc () const =0
 
virtual void init ()=0
 
- Public Member Functions inherited from OdRxModule
 ODRX_DECLARE_MEMBERS (OdRxModule)
 
virtual voidsysData ()=0
 
virtual void deleteModule ()=0
 
virtual void initApp ()=0
 
virtual void uninitApp ()=0
 
virtual OdString moduleName () const =0
 
- Public Member Functions inherited from OdRxObject
 ODRX_HEAP_OPERATORS ()
 
 OdRxObject ()
 
virtual ~OdRxObject ()
 
virtual OdRxObjectqueryX (const OdRxClass *pClass) const
 
virtual OdRxObjectx (const OdRxClass *pClass) const
 
virtual OdRxClassisA () const
 
virtual void addRef ()=0
 
virtual void release ()=0
 
virtual long numRefs () const
 
bool isKindOf (const OdRxClass *pClass) const
 
virtual OdRxObjectPtr clone () const
 
virtual void copyFrom (const OdRxObject *pSource)
 
virtual OdRx::Ordering comparedTo (const OdRxObject *pOther) const
 
virtual bool isEqualTo (const OdRxObject *pOther) const
 

Additional Inherited Members

- Static Public Member Functions inherited from OdRxObject
static OdRxObjectPtr cast (const OdRxObject *pointer)
 
static OdRxClassdesc ()
 

Detailed Description

Corresponding C++ library: TD_Db <group OdRx_Classes>

Definition at line 373 of file RxThreadPoolService.h.

Member Function Documentation

◆ executeMainThreadAction()

virtual void OdRxThreadPoolService::executeMainThreadAction ( MainThreadFunc  mtFunc,
void pArg 
)
pure virtual

Execute action in the main thread (doesn't depend on multithread queues count).

Parameters
mtFunc[in] Function to execute in the main thread.
pArg[in] Function argument to execute in the main thread.

◆ externalThreadStart()

virtual void OdRxThreadPoolService::externalThreadStart ( )
pure virtual

Inform Teigha that external thread started.

◆ externalThreadStop()

virtual void OdRxThreadPoolService::externalThreadStop ( )
pure virtual

Inform Teigha that external thread stopped.

◆ getExternalMainThreadFunc()

virtual ExecuteMainThreadFunc OdRxThreadPoolService::getExternalMainThreadFunc ( ) const
pure virtual

Returns current function for execution in the external main thread.

◆ init()

virtual void OdRxThreadPoolService::init ( )
pure virtual

◆ newEvent()

virtual OdApcEventPtr OdRxThreadPoolService::newEvent ( )
pure virtual

Creates APC event object.

◆ newGateway()

virtual OdApcGatewayPtr OdRxThreadPoolService::newGateway ( )
pure virtual

Creates APC gateway object.

◆ newLoopedGateway()

virtual OdApcLoopedGatewayPtr OdRxThreadPoolService::newLoopedGateway ( )
pure virtual

Creates APC sync point object.

◆ newMTQueue()

virtual OdApcQueuePtr OdRxThreadPoolService::newMTQueue ( unsigned  nThreadAttributes = ThreadsCounter::kNoAttributes,
int  numThreads = 0,
OdUInt32  nFlags = kMtQueueNoFlags 
)
pure virtual

Creates mutiple thread processing queue.

Parameters
nThreadAttributes[in] Set of the attributes for the threads to run.
numThreads[in] Number of threads for this queue.
nFlags[in] Set of flags for new MtQueue construction.
Remarks
If numThreads argument is zero, then the queue uses all available free threads.

◆ newObjectPool()

virtual OdApcObjectPoolPtr OdRxThreadPoolService::newObjectPool ( )
pure virtual

Creates APC object pool object.

◆ newSTQueue()

virtual OdApcQueuePtr OdRxThreadPoolService::newSTQueue ( )
pure virtual

Creates synchronized (single thread) queue.

Remarks
Returned queue is processed by one thread at one moment.

◆ newThread()

virtual OdApcThreadPtr OdRxThreadPoolService::newThread ( )
pure virtual

Creates APC thread object.

◆ numCPUs()

virtual int OdRxThreadPoolService::numCPUs ( ) const
pure virtual

Returns number of logical CPUs installed on this machine.

◆ numFreeThreads()

virtual int OdRxThreadPoolService::numFreeThreads ( ) const
pure virtual

Returns number of currently available free threads in the pool.

Remarks
(numThreads() - numFreeThreads()) - count of currently running threads.

◆ numPhysicalCores()

virtual int OdRxThreadPoolService::numPhysicalCores ( ) const
pure virtual

Returns number of physical CPU cores installed on this machine.

◆ numThreads()

virtual int OdRxThreadPoolService::numThreads ( ) const
pure virtual

Returns number of all threads in the pool.

◆ ODRX_DECLARE_MEMBERS()

OdRxThreadPoolService::ODRX_DECLARE_MEMBERS ( OdRxThreadPoolService  )

◆ registerExternalThreads()

virtual void OdRxThreadPoolService::registerExternalThreads ( unsigned  nThreads,
const unsigned *  aThreads,
unsigned  nThreadAttribs = ThreadsCounter::kNoAttributes 
)
pure virtual

Register externally executed threads.

Parameters
nThreads[in] Count of threads in aThreads array.
aThreads[in] Thread ID's array.
nThreadAttributes[in] Set of attributes for running threads.
Remarks
If application starts own threads, uses system threads, or executes threads accessed by newThread() without using Mt queue. it must register ID's of these threads to enable library Mt mode, initialization of local heaps, etc.

◆ setExternalMainThreadFunc()

virtual void OdRxThreadPoolService::setExternalMainThreadFunc ( ExecuteMainThreadFunc  execFunc)
pure virtual

Setup function for provide execution in the external main thread.

Parameters
execFunc[in] Main thread execution function.

◆ unregisterExternalThreads()

virtual void OdRxThreadPoolService::unregisterExternalThreads ( unsigned  nThreads,
const unsigned *  aThreads 
)
pure virtual

Unregister externally executed threads.

Parameters
nThreads[in] Count of threads in aThreads array.
aThreads[in] Thread ID's array.
Remarks
If application starts own threads, uses system threads, or executes threads accessed by newThread() without using Mt queue, it must register ID's of these threads to enable library Mt mode, initialization of local heaps and etc.

The documentation for this class was generated from the following file: