Home |
The ISO 9660 File System Structure The exFAT File System Structure RTFiles-32 in Embedded Applications Structure of an RTFiles-32 Program Mounting Devices and Logical Drives RTFiles-32 Buffers |
RTFiles-32 BuffersRTFiles-32's most important data structure is its buffers. Buffers are used to hold FAT and directory data, as well as application file data when data is read or written at file offsets which are not integral multiples of the sector size. The buffers also serve as RTFiles-32's cache. Data is read into the buffers as needed and is kept as long as possible. If the same data is needed again later, RTFiles-32 does not need to reread it from disk. RTFiles-32's algorithm used to determine which buffers are flushed or discarded at which time has been developed based on statistics from many tests. The application has some control over this algorithm both for individual files (RTFOpen flags RTF_COMMITTED, RTF_CACHE_DATA, and RTF_LAZY_DATA) or complete devices (device list device flag RTF_DEVICE_LAZY_WRITE). In addition, the application can control the number of available buffers and function RTFBufferInfo can be used to analyze buffer utilization and cache efficiency. Frequently, the caching strategy is a trade-off between throughput, real-time performance, and data security. RTFiles-32's default behavior corresponds to that of MS-DOS when no disk cache program is loaded:
Various options are available to override these defaults (see sections Configuring RTfiles-32 and Advanced Topics for details). It should be noted that, unless RTFOpen flag RTF_CACHE_DATA is specified, RTFiles-32's buffers are not used as an application data cache. When the application reads or writes large data blocks which completely span one or more sectors, the device driver will read/write directly from/to the buffer supplied by the application, completely bypassing RTFiles-32's buffers. This is done to avoid large application I/O requests displacing FAT and directory data in the buffer cache, since FAT and directory data are more likely to be accessed again. RTFiles-32 in Embedded Applications Mounting Devices and Logical Drives
|