The eXtremeDB disk manager supports asynchronous I/O and different multi-file formats as described in the following sections.
Asynchronous file I/O
By default, AIO is disabled. In order to use the asynchronous I/O mode, the application sets the
MCO_DB_USE_AIObit in thedb_params.mode_mask, for example:/* set default database parameters */ mco_db_params_init ( &db_params ); /* customize the params according to the application */ ... db_params.mode_mask |= MCO_DB_USE_AIO; mco_db_open_dev(dbName, testdb_get_dictionary(), dev, sizeof(dev)/sizeof(dev[0]), &db_params ); ...By default, one AIO thread is started for each database and the default queue size is set to 10007. Sometimes it could be beneficial to change the number of AIO threads (for example if the database is comprised of multiple physical IO devices, or is resided on a RAID) and/or the queue size. However note that the number of I/O threads won't exceed the number of databases created in a process, regardless of the value of worker's threads passed by the application (the runtime does not allow more than one AIO thread to serve a database)
The database runtime exports two methods:
void mco_aio_start(mco_size_t max_queue_length, mco_size_t n_workers); void mco_aio_stop();(Applications do not need to call either of these methods if the default values are acceptable.)
Multi-file databases
Multi-file devices are defined in the same manner as other persistent memory devices except that they are of type
MCO_MEMORY_MULTIFILEorMCO_MEMORY_RAIDand must specify the propertymultifile.segment_sizeorraid.level. Please refer to the SDK samples2-Open_Disk_Multifileor02-Open_Disk_Raidfor examples.For multifile implementations, segments can be added at runtime by means of the
mco_db_extend_dev()function. Note that multifile segments cannot be removed.