Home |
RTTarget-32 Programming Manual Running Win32 Programs without Win32 Running a Program on the Target Running Demos with Command Line Tools Running Demos in Microsoft Visual Studio Running Demos in the Borland Delphi IDE Using a Standard PC as a Target Using a Standard PC as a Target for GUI Demos Using the AMD Élan SC400 Evaluation Board Using the AMD Élan SC520 Evaluation Board Using the RTOS32Win Virtual Target Using the Real-Time Hypervisor Target Program FMapDemo Compiling and Linking with On Time RTOS-32 |
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.
|