gtpd1m0x | Database Reference |
VFA requires the following information about resources:
VFA main storage occupies the area following the end of working storage, and includes the VFA tables and VFA buffers. The VFA tables are used by the VFA control program to manage its buffers. The VFA buffers are the main storage in which VFA candidate records reside.
There are three types of VFA buffers:
The number of buffers allocated for each type is computed by VFA from user-defined ratios. The buffers are chained together in either one of two chains:
The first chain is the aging chain. This chain contains the majority of the records in VFA. When a record is added to VFA, it is copied into a buffer that is allocated from the reserve chain, which is the second chain, and then placed on the aging chain. VFA determines the most active records by maintaining a reference counter for each resident record. This counter is incremented each time the record is referenced by a macro. When a record is copied into VFA, the counter is set to zero and the record buffer is placed on the bottom of the aging chain. Each time the record is referenced, the counter is incremented. When the size of the reserve chain falls below the specified percentage, the top buffer on the aging chain is accessed and its reference count is compared to the user-defined value. If the reference counter is greater than the user-defined value, the count is zeroed and the entry is placed on the bottom of the aging chain. Otherwise, the buffer is moved to the reserve chain and if there is a delay file pending in the buffer, the write is scheduled. This checking of the aging chain continues until the reserve chain is at the percentage specified.
Therefore, the aging chain is used to hold the current VFA resident records that may have delay files pending. The reserve chain is used to hold those records that can be overlaid with a new VFA candidate because they were not referenced a minimum number of times and the records do not have a delay file pending. Any record on the reserve chain can still be referenced by an application find.
The size of the reserve chain should be such that when a delay file buffer is moved from the aging chain to the reserve chain and the write is scheduled, the write is completed by the time an attempt is made to allocate the buffer for a new record. Buffers on the reserve chain are used for both candidates and non-candidate write requests. Buffers used for non-candidate write requests are placed on the top of the reserve chain once the write is completed.