contents.gifindex.gifprev1.gifnext1.gif

V-LOCK-METHOD

V-LOCK-METHOD* - This variable selects which locking method Vision will use to control simultaneous access to indexed files. It affects only the Vision file system, and only files directly accessed by the runtime (it does not apply to files accessed via AcuServer).

The default setting of "0" (zero) causes Vision to lock the first byte of the file for every access to the file (both reads and updates). This ensures that the process is not interfered with by another process. This locking method is always used by Vision Version 2 files.

Setting this variable to "1" causes Vision to lock the first byte of the file for all operations except random READs or READ NEXTs. These two operations proceed without the lock. Instead they perform some additional reads of the file, to ensure that they get consistent results. If they get inconsistent results, they are retried, this time locking the first byte as other operations do. This locking method is available only for Vision Version 3 and Version 4 files.

Lock method "1" can produce better performance on some machines. These machines fall into two categories:

gt490000.gif Machines that take a long time to place a lock.

gt490000.gif Machines that do not queue lock requests, and are very busy. In this case, some users typically get good performance, while others get poor performance.

If you are experiencing poor performance on Vision Version 3 or 4 files, setting V-LOCK-METHOD to "1" may help.

For example, setting V-LOCK-METHOD to "1" can be helpful on some Windows networks. A peer-to-peer network of Windows 95 machines can exhibit problems reading Vision files when a process performs a tight read loop. The problem usually surfaces as either an error 30,33 or an unexpected error 99. This occurs because the runtime is unable to place a lock on the header of the file after 400 attempts over a 20-second period. The inability to queue lock requests is an architectural weakness of DOS networks in general, but server-oriented software (such as Novell and Windows NT) seems to handle the situation adequately. For other networks, setting V-LOCK-METHOD to "1" can substantially reduce the number of lock requests made by the runtime and can often resolve these problems.

To get statistics about header locks, select Trace Files level "3" in the debugger (for example, "TF 3"). These statistics print on the runtime's error output each time a Vision file is closed. They cover the operations in that file since it was last opened. You can also view these statistics (without the full trace) by adding "256" to the lock method chosen (for example, setting V-LOCK-METHOD to "257" selects method "1" and prints statistics).