TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | List of all members
iConcurrent Struct Referenceabstract
Inheritance diagram for iConcurrent:
iUnknown

Public Member Functions

virtual tU64 GetMainThreadID () const =0
 {Property} More...
 
virtual tU64 GetCurrentThreadID () const =0
 {Property} More...
 
virtual iRunnableQueueCreateRunnableQueue (tU64 aThreadID, tU32 aMaxItems)=0
 Create a runnable queue for the specified thread. More...
 
virtual iExecutorCreateExecutorCooperative (tU64 aThreadID, tU32 aMaxItems)=0
 Create a cooperative executor. More...
 
virtual iExecutorCreateExecutorImmediate ()=0
 Create an immediate executor. More...
 
virtual iExecutorCreateExecutorThreadPool (tI32 aNumThreads)=0
 Create a threaded executor. More...
 
virtual iExecutorGetExecutorCPU ()=0
 Get the default executor. More...
 
virtual iExecutorGetExecutorIO ()=0
 Get the IO executor. More...
 
virtual iExecutorGetExecutorMain ()=0
 Get the cooperative executor bound to the main thread. {Property}. More...
 
virtual Ptr< iFutureThreadRun (iRunnable *apRunnable)=0
 Creates a new thread and run the runnable in it. More...
 
virtual iFutureValueCreateFutureValue ()=0
 Create a future value object. More...
 
virtual Ptr< iMessageDescCreateMessageDesc (iMessageHandler *apHandler, tU32 anMsg, const Var &avarA, const Var &avarB)=0
 Create a message desc object. More...
 
virtual Ptr< iMessageQueueCreateMessageQueue (tU64 anThreadID, tU32 aMaxItems)=0
 Create a message queue for the specified thread. More...
 
virtual Ptr< iMessageQueueGetMessageQueue (tU64 anThreadID) const =0
 Get the message queue associated with the specified thread. {Property}. More...
 
virtual tBool SendMessage (iMessageHandler *apHandler, tU32 anMsg, const Var &avarA, const Var &avarB)=0
 Send a message to the specified message handler. More...
 
virtual tBool QueueMessage (iMessageHandler *apHandler, tU32 anMsg, const Var &avarA, const Var &avarB)=0
 Queue a message in the messge queue of the message handler's thread. More...
 
- Public Member Functions inherited from iUnknown
virtual tBool IsOK () const =0
 Check if the object is valid. More...
 
virtual tI32 AddRef ()=0
 Signal that one more reference of the object has been created. More...
 
virtual tI32 Release ()=0
 Release a reference of the object. More...
 
virtual void DeleteThis ()=0
 Bypass any reference counting and delete this object. More...
 
virtual void Invalidate ()=0
 Invalidate the object. More...
 
virtual iUnknownQueryInterface (const tUUID &aIID)=0
 Query an interface. More...
 
virtual void ListInterfaces (iMutableCollection *apLst, tU32 anFlags) const =0
 Fill a UUID list containing the UUIDs of the implemented interfaces. More...
 
virtual tI32 SetNumRefs (tI32 anNumRefs)=0
 Set the reference counter directly. More...
 
virtual tI32 GetNumRefs () const =0
 Get the number of references to this object. More...
 

Member Function Documentation

virtual tU64 GetMainThreadID ( ) const
pure virtual

{Property}

virtual tU64 GetCurrentThreadID ( ) const
pure virtual

{Property}

virtual iRunnableQueue* CreateRunnableQueue ( tU64  aThreadID,
tU32  aMaxItems 
)
pure virtual

Create a runnable queue for the specified thread.

virtual iExecutor* CreateExecutorCooperative ( tU64  aThreadID,
tU32  aMaxItems 
)
pure virtual

Create a cooperative executor.

virtual iExecutor* CreateExecutorImmediate ( )
pure virtual

Create an immediate executor.

virtual iExecutor* CreateExecutorThreadPool ( tI32  aNumThreads)
pure virtual

Create a threaded executor.

Remarks
Always fails on single-threaded platforms.
virtual iExecutor* GetExecutorCPU ( )
pure virtual

Get the default executor.

The default executor is created with one thread for 2 logical cores, with at least one thread. It should be used for CPU intensive tasks.

Remarks
On purely single-threaded platforms returns GetExecutorMain().

{Property}

virtual iExecutor* GetExecutorIO ( )
pure virtual

Get the IO executor.

The IO executor is created with 2 threads per logical core. It should be used for IO bound tasks.

Remarks
On purely single-threaded platforms returns GetExecutorMain().

{Property}

virtual iExecutor* GetExecutorMain ( )
pure virtual

Get the cooperative executor bound to the main thread. {Property}.

Remarks
All the runnable submitted to this executor are garanteed to be executed in the main thread.
virtual Ptr<iFuture> ThreadRun ( iRunnable apRunnable)
pure virtual

Creates a new thread and run the runnable in it.

virtual iFutureValue* CreateFutureValue ( )
pure virtual

Create a future value object.

virtual Ptr<iMessageDesc> CreateMessageDesc ( iMessageHandler apHandler,
tU32  anMsg,
const Var avarA,
const Var avarB 
)
pure virtual

Create a message desc object.

virtual Ptr<iMessageQueue> CreateMessageQueue ( tU64  anThreadID,
tU32  aMaxItems 
)
pure virtual

Create a message queue for the specified thread.

Remarks
Only one message queue can be created per thread, subsequent calls to create a queue for the same thread will fail.
virtual Ptr<iMessageQueue> GetMessageQueue ( tU64  anThreadID) const
pure virtual

Get the message queue associated with the specified thread. {Property}.

virtual tBool SendMessage ( iMessageHandler apHandler,
tU32  anMsg,
const Var avarA,
const Var avarB 
)
pure virtual

Send a message to the specified message handler.

Remarks
If the handler's thread is the same as the current thread then the handler is called immediatly. Otherwise the message queue's of the handler's thread is retrieved and the message is pushed in the queue.
Returns
eTrue if the message as been added to the handler's thread message queue or if the handler has been called immediatly. Otherwise returns eFalse.
virtual tBool QueueMessage ( iMessageHandler apHandler,
tU32  anMsg,
const Var avarA,
const Var avarB 
)
pure virtual

Queue a message in the messge queue of the message handler's thread.

Returns
eTrue if the message as been added to the handler's thread message queue. Otherwise returns eFalse.