theLink 10.0
Loading...
Searching...
No Matches
MqRuntimeC_C_API

MqRuntimeS - the class known as rt or runtime is main libmqmsgque application environment … More...

+ Collaboration diagram for MqRuntimeC_C_API:

Topics

 MqRuntimeC_Class_C_API
 MqRuntimeS - define the class …
 
 MqRuntimeC_Class_Define_C_API
 MqRuntimeS - low level definition, access and cast …
 

Data Structures

struct  MqRuntimeS
 Extend the MkRuntimeS wie libmqmsgque specific features … More...
 

Macros

#define MQ_INSTANCE_RT_X(x)
 
#define MQ_INSTANCE_RT_X_NULL(x)
 
#define MQ_INSTANCE_RT_O(o)
 
#define MQ_INSTANCE_RT_O_NULL(o)
 
#define MQ_DESTRUCTOR_RT_X(c, x)
 
#define MQ_STATIC_RT   MK_STATIC_RT ; MqRtSetup_NULL
 
#define MqDbgRt()
 

Variables

bool MqRuntimeThreadPoolUse
 

definition

use the thread-enabled-api by using the META_HAS_THREAD preprocessor define

In a thread-environment (libmqmsgque is build with thread support) every thread has its own runtime. This runtime is created as T)hread-L)ocal-S)torage (TLS) and is available using the MkRt call. Using the MkRt call is an expensive task, because it is a function-call. Multiple usage of MkRt create multiple function-calls and this is expensive.

To speed this up, two additional technologies are available: #1 the runtime is saved into the object of an instance at obj->runtime #1 instance->path.to.obj.runtime // this is typesafe #2 the runtime is added as first parameter (called "mkrt") to the callback call #1 example: callback( MQ_SERVICE_CALL_ARGS )

If libmqmsgque was not build with thread support than the API changes #1 the first argument "mkrt" is missing #2 the MkRt is always the fastest access to the runtime.

To join the two different styles (with/without thread) into one API the MQ_RT_* style macros are available. The most important one is the MQ_RT_REF. The MQ_RT_REF always return a reference (not a pointer) to the runtime. The access-qualifier for a reference is "." and for a pointer is "->".

  • MQ_RT_REF = reference, &MQ_RT_REF = pointer
#define MQ_RT_ARGS_ONLY   MK_RT mkrt, MQ_RT mqrt
 
#define MQ_RT_ARGS   MQ_RT_ARGS_ONLY,
 
#define MQ_RT_CALL_ONLY   mkrt, mqrt
 
#define MQ_RT_CALL   MQ_RT_CALL_ONLY,
 
#define MQ_RT_PTR   mqrt
 
#define MQ_RT_REF   (*mqrt)
 

Detailed Description

MqRuntimeS - the class known as rt or runtime is main libmqmsgque application environment …

The runtime is automatically created as thread-local-storage at startup, so that each new thread receives a thread-specific runtime. Each instance on this thread has a link to the runtime it was created in:

The runtime provide the following features:

Macro Definition Documentation

◆ MQ_DESTRUCTOR_RT_X

#define MQ_DESTRUCTOR_RT_X ( c,
x )
Value:
#define MqRtSetup_XN(x)
#define MK_DESTRUCTOR_RT_X(c, x)

Definition at line 235 of file LibMqMsgque_mq.h.

◆ MQ_INSTANCE_RT_O

#define MQ_INSTANCE_RT_O ( o)
Value:
#define MqRtSetup_ON(o)
#define MK_INSTANCE_RT_O(o)

Definition at line 233 of file LibMqMsgque_mq.h.

◆ MQ_INSTANCE_RT_O_NULL

#define MQ_INSTANCE_RT_O_NULL ( o)
Value:
#define MqRtSetup_O(o)
#define MK_INSTANCE_RT_O_NULL(o)

Definition at line 234 of file LibMqMsgque_mq.h.

◆ MQ_INSTANCE_RT_X

#define MQ_INSTANCE_RT_X ( x)
Value:
#define MK_INSTANCE_RT_X(x)

Definition at line 231 of file LibMqMsgque_mq.h.

◆ MQ_INSTANCE_RT_X_NULL

#define MQ_INSTANCE_RT_X_NULL ( x)
Value:
#define MqRtSetup_X(x)
#define MK_INSTANCE_RT_X_NULL(x)

Definition at line 232 of file LibMqMsgque_mq.h.

◆ MQ_RT_ARGS

#define MQ_RT_ARGS   MQ_RT_ARGS_ONLY,

Definition at line 215 of file LibMqMsgque_mq.h.

◆ MQ_RT_ARGS_ONLY

#define MQ_RT_ARGS_ONLY   MK_RT mkrt, MQ_RT mqrt

Definition at line 214 of file LibMqMsgque_mq.h.

◆ MQ_RT_CALL

#define MQ_RT_CALL   MQ_RT_CALL_ONLY,

Definition at line 217 of file LibMqMsgque_mq.h.

◆ MQ_RT_CALL_ONLY

#define MQ_RT_CALL_ONLY   mkrt, mqrt

Definition at line 216 of file LibMqMsgque_mq.h.

◆ MQ_RT_PTR

#define MQ_RT_PTR   mqrt

Definition at line 218 of file LibMqMsgque_mq.h.

◆ MQ_RT_REF

#define MQ_RT_REF   (*mqrt)

Definition at line 219 of file LibMqMsgque_mq.h.

◆ MQ_STATIC_RT

#define MQ_STATIC_RT   MK_STATIC_RT ; MqRtSetup_NULL

Definition at line 236 of file LibMqMsgque_mq.h.

◆ MqDbgRt

#define MqDbgRt ( )
Value:
mk_dbg_color_ln(MK_COLOR_PURPLE,"mkrt<%p>, MkRT<%p>, mqrt<%p>, MqRT<%p>", mkrt, MkRT, mqrt, MqRT)
#define MqRT
#define MkRT

Definition at line 9167 of file LibMqMsgque_mq.h.

Variable Documentation

◆ MqRuntimeThreadPoolUse

bool MqRuntimeThreadPoolUse
extern