theKernel 10.0
Loading...
Searching...
No Matches
MkKernel_Setup_libmkkernel_CC_API

MkKernel PACKAGE - Setup und Cleanup the ccmkkernelMore...

+ Collaboration diagram for MkKernel_Setup_libmkkernel_CC_API:

Functions

static void ccmkkernel::MkKernel::Cleanup ()
  C++: [static] MkKernel::Cleanup() C-API
cleanup ccmkkernel internal memory …
 
static void ccmkkernel::MkKernel::Setup ()
  C++: [static] MkKernel::Setup() C-API
setup ccmkkernel internal memory …
 
static void ccmkkernel::MkKernel::CcMkCleanup ()
  C++: [static] MkKernel::Cleanup() C-API
cleanup ccmkkernel internal memory …
 
static void ccmkkernel::MkKernel::CcMkSetup ()
  C++: [static] MkKernel::Setup() C-API
setup ccmkkernel internal memory …
 

Detailed Description

MkKernel PACKAGE - Setup und Cleanup the ccmkkernel

Initializing a ccmkkernel library depends on the Target-Programming-Language (TPL) and the specific nature of the Programming-Language-Micro-Kernel (PLMK).

In general it is required to call a Setup style funtion as FIRST command because of:

If more than one META library is called only the toplevel Setup is required:

shared library detail

A new ccmkkernel library is initialized with Setup and released again with Cleanup. Both functions are automatically called upon loading and unloading of the shared library.

Example: Definition (C) of the ccmkkernel library startup functions

MK_EXTERN void MK_DECL MkSetup (void) __attribute__ ((constructor(200)));
MK_EXTERN void MK_DECL MkCleanup (void) __attribute__ ((destructor(200)));
#define MK_DECL
#define MK_EXTERN
static library
void MkSetup(void)
setup ccmkkernel internal memory …
void MkCleanup(void)
cleanup ccmkkernel internal memory …

In the Programming-Language-Micro-Kernel (PLMK), a type is defined for each thread, which means that the new ccmkkernel library must be known when the thread starts. This is not a problem as long as the external ccmkkernel library is linked to the application. However, if dlopen is used to load the ccmkkernel library, the current restriction is that the new data type from the ccmkkernel library has not been defined in all existing threads.

The point in time when a library is loaded depends heavily on the programming language used.

‍To avoid all the problems call the Setup directly at the start of the main program.

Example: Start of the LcConfigServer application from the example/cs directory

static void Main(string[] argv) {
LcConfig.Setup();
var srv = MqFactoryCT<LcConfigServer>.Add().New();
try {
srv.LinkCreate(argv);
srv.ProcessEvent(MqWaitOnEventE.FOREVER);
} catch (Exception e) {
srv.ErrorCatch(e);
}
srv.Exit();
}

Initializing a ccmkkernel library depends on the Target-Programming-Language (TPL) and the specific nature of the Programming-Language-Micro-Kernel (PLMK).

In general it is required to call a Setup style funtion as FIRST command because of:

If more than one META library is called only the toplevel Setup is required:

shared library detail

A new ccmkkernel library is initialized with Setup and released again with Cleanup. Both functions are automatically called upon loading and unloading of the shared library.

Example: Definition (C) of the ccmkkernel library startup functions

MK_EXTERN void MK_DECL MkSetup (void) __attribute__ ((constructor(200)));
MK_EXTERN void MK_DECL MkCleanup (void) __attribute__ ((destructor(200)));

In the Programming-Language-Micro-Kernel (PLMK), a type is defined for each thread, which means that the new ccmkkernel library must be known when the thread starts. This is not a problem as long as the external ccmkkernel library is linked to the application. However, if dlopen is used to load the ccmkkernel library, the current restriction is that the new data type from the ccmkkernel library has not been defined in all existing threads.

The point in time when a library is loaded depends heavily on the programming language used.

‍To avoid all the problems call the Setup directly at the start of the main program.

Example: Start of the LcConfigServer application from the example/cs directory

static void Main(string[] argv) {
LcConfig.Setup();
var srv = MqFactoryCT<LcConfigServer>.Add().New();
try {
srv.LinkCreate(argv);
srv.ProcessEvent(MqWaitOnEventE.FOREVER);
} catch (Exception e) {
srv.ErrorCatch(e);
}
srv.Exit();
}

Initializing a ccmkkernel library depends on the Target-Programming-Language (TPL) and the specific nature of the Programming-Language-Micro-Kernel (PLMK).

In general it is required to call a Setup style funtion as FIRST command because of:

If more than one META library is called only the toplevel Setup is required:

shared library detail

A new ccmkkernel library is initialized with Setup and released again with Cleanup. Both functions are automatically called upon loading and unloading of the shared library.

Example: Definition (C) of the ccmkkernel library startup functions

MK_EXTERN void MK_DECL MkSetup (void) __attribute__ ((constructor(200)));
MK_EXTERN void MK_DECL MkCleanup (void) __attribute__ ((destructor(200)));

In the Programming-Language-Micro-Kernel (PLMK), a type is defined for each thread, which means that the new ccmkkernel library must be known when the thread starts. This is not a problem as long as the external ccmkkernel library is linked to the application. However, if dlopen is used to load the ccmkkernel library, the current restriction is that the new data type from the ccmkkernel library has not been defined in all existing threads.

The point in time when a library is loaded depends heavily on the programming language used.

‍To avoid all the problems call the Setup directly at the start of the main program.

Example: Start of the LcConfigServer application from the example/cs directory

static void Main(string[] argv) {
LcConfig.Setup();
var srv = MqFactoryCT<LcConfigServer>.Add().New();
try {
srv.LinkCreate(argv);
srv.ProcessEvent(MqWaitOnEventE.FOREVER);
} catch (Exception e) {
srv.ErrorCatch(e);
}
srv.Exit();
}

Function Documentation

◆ CcMkCleanup()

void ccmkkernel::MkKernel::CcMkCleanup ( )
static

C++: [static] MkKernel::Cleanup() C-API
cleanup ccmkkernel internal memory …

Definition at line 96 of file LibMkKernel_cc.cc.

96 {
99 MkCleanup();
100 }
#define MK_RT_CALL
void MkRuntimeCallbackDel(MK_RT mkrt, MkRuntimeCallbackS *cbdata)
delete a callback from the runtime …
#define MkRtSetup_NULL
static struct MkRuntimeCallbackS sMkRuntimeCallback
+ Here is the caller graph for this function:

◆ CcMkSetup()

void ccmkkernel::MkKernel::CcMkSetup ( )
static

C++: [static] MkKernel::Setup() C-API
setup ccmkkernel internal memory …

Definition at line 104 of file LibMkKernel_cc.cc.

104 {
105 MkSetup();
107
108 MkRuntimeCallbackAdd( MK_RT_CALL &sMkRuntimeCallback, mk_static_init_callback, "CcMkKernel" );
109 }
size_t MkRuntimeCallbackAdd(MK_RT mkrt, MkRuntimeCallbackS *cbdata, MkRuntimeInitF rt_callback, MK_STRN ident)
add a callback to the runtime …
#define AllRtSetup_NULL
+ Here is the caller graph for this function:

◆ Cleanup()

void ccmkkernel::MkKernel::Cleanup ( )
static

C++: [static] MkKernel::Cleanup() C-API
cleanup ccmkkernel internal memory …

Definition at line 124 of file LibMkKernel_cc.cc.

124 {
127 }
#define MkCleanupTmpl()

◆ Setup()

void ccmkkernel::MkKernel::Setup ( )
static

C++: [static] MkKernel::Setup() C-API
setup ccmkkernel internal memory …

Definition at line 130 of file LibMkKernel_cc.cc.

130 {
132 MkSetupTmpl();
133 }
#define MkSetupTmpl()