Mapped Access to Disc Files

MPE/iX emplo ys a \mapped ￿les" tec hnique for performing disc ￿le access. File access

e￿ciency is impro ved when code and data portions of ￿les required for processing reside in memory. Accessing memory is faster than performing ph ysical disc I/O operations. The mapped ￿les technique eliminates ￿le system bu￿ering and optimizes global system memory management.

File mapping is based on MPE/iX demand paged virtual memory , which uses to advantage the large amount of virtual memory on the system. When a ￿le is opened, it is logically mapped into virtual memory. An open ￿le and its con tents are referenced by virtual addresses. Eac h byte of each opened ￿le has a unique virtual address.

File mapping impro ves I/O performance without imposing additional CPU o verhead or sacri￿cing data in tegrity and protection. Traditional disc cac hing schemes for increasing I/O performance impose a CPU o verhead penalty. The 900 Series hardw are and system architecture allow MPE/iX to perform ￿le mapping without incurring this penalt y. System hardware performs the virtual to ph ysical address translations for locating portions of the mapped ￿les, thus eliminating CPU o verhead for this function.

If the required pages are not in memory , the MPE/iX Memory Manager fetc hes them directly from disc and places them in memory . This eliminates File System bu￿ering. P ages are \prefetched" to reduce the amoun t of physical disc I/O. Prefetc hing means that the page speci￿ed for fetching and the group of pages surrounding it are a fetc hed all at once. This improves e￿ciency because the processor is likely to require pages that are located near eac h other. Two bene￿ts of this are:

Eliminating unnecessary data mo vement in memory impro ves system performance.

Memory space usage is optimized.

MPE/iX File System access in trinsics are built on the mapped ￿le tec hnique. Programs using ￿le access methods supported b y MPE ￿le types and intrinsics obtain the bene￿ts of ￿le mapping without requiring c hanges.

You can directly access mapped ￿les when programming in Native Mode languages with pointers by using the HPFOPEN intrinsic. For example, you can obtain the adv antage of File System naming and data protection for accessing array t ype structures and dev eloping specialized access methods.

You can write programs that address ￿les through virtual memory , instead of calling File System intrinsics for disc reading and writing. The ￿le in terface provides opening and closing of user mapped ￿les with normal naming and securit y, but with impro ved LOAD and STORE speed on ￿le references.

Multiple Record Transfers

In most applications, programs conduct input and output in normal recording mode, where each read or write request transfers one logical record to or from the stac k. In specialized applications, ho wever, you may want a program to read or write, in a single operation, data that exceeds the logical record length de￿ned for the input or output ￿le. F or example, multirecord transfer ma y be preferable, as a good programming practice, for applications that run only on MPE/iX.

File System 6-31