theLink 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - py - rb - jv - cc
Loading...
Searching...
No Matches
MqRuntimeC_C_API

MqRuntimeS - the class known as rt or runtime is main pymqmsgque 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 PythonMqMsgque specific features … More...
 

Macros

#define __MQ_ATTR_DEFINED   __parser__(ATTR-DEFINED=MQ)
 
#define MQ_ATTR_INSTANCE   MK_ATTR_INSTANCE __MQ_ATTR_DEFINED
 
#define MQ_ATTR_RT_INSTANCE   MK_ATTR_RT_INSTANCE __MQ_ATTR_DEFINED
 
#define MQ_ATTR_CLASS   MK_ATTR_CLASS __MQ_ATTR_DEFINED
 
#define MQ_ATTR_RT_CLASS   MK_ATTR_RT_CLASS __MQ_ATTR_DEFINED
 
#define MQ_INSTANCE_RT_X(x)
 
#define MQ_INSTANCE_RT_XN(x)
 
#define MQ_INSTANCE_RT_O(o)
 
#define MQ_INSTANCE_RT_ON(o)
 
#define MQ_DESTRUCTOR_RT_X(c, x)
 
#define MQ_STATIC_RT   MK_CLASS_RT ; MqRtSetup_NULL
 

definition

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

In a thread-environment (pymqmsgque 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 pymqmsgque 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_IS_ARG
 
#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_CALL_NULL_ONLY   MkRT, MqRT
 
#define MQ_RT_CALL_NULL   MQ_RT_CALL_NULL_ONLY,
 
#define MQ_RT_PTR   mqrt
 
#define MQ_RT_REF   (*mqrt)
 

Detailed Description

MqRuntimeS - the class known as rt or runtime is main pymqmsgque 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_ATTR_DEFINED

#define __MQ_ATTR_DEFINED   __parser__(ATTR-DEFINED=MQ)

Definition at line 218 of file LibMqMsgque_mq.h.

◆ MQ_ATTR_CLASS

#define MQ_ATTR_CLASS   MK_ATTR_CLASS __MQ_ATTR_DEFINED

Definition at line 223 of file LibMqMsgque_mq.h.

◆ MQ_ATTR_INSTANCE

#define MQ_ATTR_INSTANCE   MK_ATTR_INSTANCE __MQ_ATTR_DEFINED

Definition at line 221 of file LibMqMsgque_mq.h.

◆ MQ_ATTR_RT_CLASS

#define MQ_ATTR_RT_CLASS   MK_ATTR_RT_CLASS __MQ_ATTR_DEFINED

Definition at line 224 of file LibMqMsgque_mq.h.

◆ MQ_ATTR_RT_INSTANCE

#define MQ_ATTR_RT_INSTANCE   MK_ATTR_RT_INSTANCE __MQ_ATTR_DEFINED

Definition at line 222 of file LibMqMsgque_mq.h.

◆ 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 231 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 229 of file LibMqMsgque_mq.h.

◆ MQ_INSTANCE_RT_ON

#define MQ_INSTANCE_RT_ON ( o)
Value:
#define MK_INSTANCE_RT_ON(o)

Definition at line 230 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 227 of file LibMqMsgque_mq.h.

◆ MQ_INSTANCE_RT_XN

#define MQ_INSTANCE_RT_XN ( x)
Value:
#define MK_INSTANCE_RT_XN(x)

Definition at line 228 of file LibMqMsgque_mq.h.

◆ MQ_RT_ARGS

#define MQ_RT_ARGS   MQ_RT_ARGS_ONLY,

Definition at line 194 of file LibMqMsgque_mq.h.

◆ MQ_RT_ARGS_ONLY

#define MQ_RT_ARGS_ONLY   MK_RT mkrt, MQ_RT mqrt

Definition at line 193 of file LibMqMsgque_mq.h.

◆ MQ_RT_CALL

#define MQ_RT_CALL   MQ_RT_CALL_ONLY,

Definition at line 196 of file LibMqMsgque_mq.h.

◆ MQ_RT_CALL_NULL

#define MQ_RT_CALL_NULL   MQ_RT_CALL_NULL_ONLY,

Definition at line 198 of file LibMqMsgque_mq.h.

◆ MQ_RT_CALL_NULL_ONLY

#define MQ_RT_CALL_NULL_ONLY   MkRT, MqRT

Definition at line 197 of file LibMqMsgque_mq.h.

◆ MQ_RT_CALL_ONLY

#define MQ_RT_CALL_ONLY   mkrt, mqrt

Definition at line 195 of file LibMqMsgque_mq.h.

◆ MQ_RT_IS_ARG

#define MQ_RT_IS_ARG

Definition at line 192 of file LibMqMsgque_mq.h.

◆ MQ_RT_PTR

#define MQ_RT_PTR   mqrt

Definition at line 199 of file LibMqMsgque_mq.h.

◆ MQ_RT_REF

#define MQ_RT_REF   (*mqrt)

Definition at line 200 of file LibMqMsgque_mq.h.

◆ MQ_STATIC_RT

#define MQ_STATIC_RT   MK_CLASS_RT ; MqRtSetup_NULL

Definition at line 232 of file LibMqMsgque_mq.h.