Start the database runtime.
MCO_RET mco_runtime_start(void)
void |
No arguments |
This function initializes a semaphore to coordinate access to the database dictionary. It must be called once, and only once, from each process that uses the eXtremeDB runtime, before the database is created with
mco_db_open_dev()
ormco_db_load()
by the first process and before the database is connected to within subsequent processes. All applications must call
mco_db_connect()
mco_runtime_start()
to start and then mco_runtime_stop() to shut down the runtime gracefully before the application terminates. (Note that shared memory applications also need to start and stop the runtime.)eXtremeSQL applications can start the runtime implicitly by calling the McoSqlEngine method
open(McoSqlOpenParameters const ¶ms)
with theSTART_MCO_RUNTIME
flag set in the McoSqlOpenParameters argumentparams
. This flag is set by default. When the McoSqlEngine methodclose()
is called the runtime is stopped implicitly.
MCO_S_OK | The database was created successfully |
MCO_E_SHM_ERROR | Failed to allocate shared memory. (If using a shared memory database.) |
Application snippet: int main(int argc, char* argv[]) { mco_db_h db; MCO_RET rc; mco_device_t dev; mco_db_params_t db_params; if( (rc = mco_runtime_start()) != MCO_S_OK) exit(-1); ... mco_runtime_stop(); }