theKernel 10.0
Loading...
Searching...
No Matches
MkKernel_Setup_libmkkernel_ATL_API

MkKernel PACKAGE - Setup und Cleanup the atlmkkernelMore...

+ Collaboration diagram for MkKernel_Setup_libmkkernel_ATL_API:

Functions

static OT_ProcRet atlmkkernel_MkKernel_Cleanup (OtClass_ARGS)
  Atl: (static) MkKernel::Cleanup C-API
cleanup atlmkkernel internal memory …
 
static OT_ProcRet atlmkkernel_MkKernel_Setup (OtClass_ARGS)
  Atl: (static) MkKernel::Setup C-API
setup atlmkkernel internal memory …
 

Detailed Description

MkKernel PACKAGE - Setup und Cleanup the atlmkkernel

Initializing a atlmkkernel 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 atlmkkernel 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 atlmkkernel 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 atlmkkernel internal memory …
void MkCleanup(void)
cleanup atlmkkernel internal memory …

In the Programming-Language-Micro-Kernel (PLMK), a type is defined for each thread, which means that the new atlmkkernel library must be known when the thread starts. This is not a problem as long as the external atlmkkernel library is linked to the application. However, if dlopen is used to load the atlmkkernel library, the current restriction is that the new data type from the atlmkkernel 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

◆ atlmkkernel_MkKernel_Cleanup()

static OT_ProcRet atlmkkernel_MkKernel_Cleanup ( OtClass_ARGS )
static

Atl: (static) MkKernel::Cleanup C-API
cleanup atlmkkernel internal memory …

Definition at line 1837 of file LibMkKernel_atl.c.

1837 {
1841 MkCleanupTmpl ();
1843 goto end;
1844 error:
1846 end:
1848}
#define MkCleanupTmpl()
#define OT_SETUP_hdl_static
#define Cleanup_doc
#define OT_SETUP_NOARG(d)
#define OT_retObj_SET_Error
#define OT_retObj_SET_None
#define OT_retObj_RETURN
#define OT_CHECK_NOARGS

◆ atlmkkernel_MkKernel_Setup()

static OT_ProcRet atlmkkernel_MkKernel_Setup ( OtClass_ARGS )
static

Atl: (static) MkKernel::Setup C-API
setup atlmkkernel internal memory …

Definition at line 1851 of file LibMkKernel_atl.c.

1851 {
1855 MkSetupTmpl ();
1857 goto end;
1858 error:
1860 end:
1862}
#define MkSetupTmpl()
#define Setup_doc