| System Parameters |
|
| The Share
Handle functionality is a +PxPlus
Exclusive |
||
| Description | The SH
parameter controls the sharing of operating system
handles (the logical connection between your application
and a data file) and data buffers whenever the same file
is opened more than once. When the 'SH' system parameter is enabled during the file open process, the system will compare pathnames of the file being opened with those of other currently open VLR/FLR files. If the same file is already opened, the system will internally share that connection and all associated file buffers. Files that are opened for LOCK or files opened in one instance for Read/Write and another for Read only will not be shared. |
|
| * Note * | The 'SH' parameter only works with VLR or FLR files, not EFF files. | |
| Advantages | The 'SH'
system parameter can be used to increase system
performance in cases where the same file is opened more
than once. It avoids the OS overheads associated with
opening the file and by sharing buffers allows the system
to access the data quicker. There are many instances where the same file is opened more than once in most applications. For example, a typical maintenance program will open a master file and often provide access to a generic query facility to lookup record IDs. Usually this means that the master file will be opened once by the maintenance program and once by the query. The following sample program can be used to see the difference that sharing handles and buffers can make.
|
|
| * Notice * | While the
'SH' parameter can be used in most instances to improve
system performance, if a file is renamed while open,
there is a possibility that the logic might fail. For example, assuming the parameter is on and your application issued:
If the directory 'company_1' was then renamed to 'company_xx' and a new file1 was created:
Now, if your application issued another open to the same pathname, as in:
The system will incorrectly assume that this is the same as the original file1 opened on channel 10. The net effect is that channel 100 will be actually pointing to what is now "/myapp/data/company_xx/file1" not "/myapp/data/company_1/file1". Without the 'SH' parameter enabled, the system would have correctly opened the new file1. The possibilities of this occurring are very very low and most applications will never encounter this situation. |
|
| Default | Off. By default |