![]() |
Home |
|
Program FMapDemoFMapDemo demonstrates the use of memory mapped files to implement a thread safe, high throughput data base. The program requires RTFiles-32 and RTKernel-32. Source file Memdata.hpp contains template class MappedDataBase which implements a simple database file accessed as a memory mapped file. Note that no access locking is performed by this class. Applications which plan to access the database from several threads must provide suitable locking. Demo program FMapDemo uses a Guard object (see Guard.hpp). Template class MappedHashIndex implements a simple index file, also as a memory mapped file. FMapDemo creates five Reader threads which will search and retrieve random records from the memory mapped database. A status task displays the current throughput, CPU load, and page faults per second once per second. The main task accepts commands from the user. For example, command "GEN" will create the request number of random database records. Type "HELP" for an overview of all commands. Please note that FMapDemo does not implement a full-featured database. It merely introduces some basic concepts of how a database could be implemented using memory mapped files.
|