#36

File flushing

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS

Synergy writes data directly to the operating system, but in many cases, the operating system caches data before writing it to the actual media. A flush operation is required to bypass this behavior. By default, the runtime does not flush WRITE, STORE, or DELETE operations on indexed, sequential, and relative files to disk. (The runtime does, however, flush ISAM files to disk after a CLOSE operation.) In addition, the runtime buffers WRITES to sequential files (open in output or append mode) in 8K buffers and only writes the cache buffer to the operating system when the buffer is full. This is done to improve sequential write performance, especially over mapped drives.

Setting system option #36 enables the flushing feature of the runtime for non‑sequential files and uses the O_DSYNC file open flag. This ensures that all writes to the disk are flushed for data integrity; however, the file modification time is still cached. This is the best compromise between performance and guaranteed data integrity. Our current method of flushing ISAM files to disk flushes past any write caching that may be set up on the system. If system option #36 is set and you want to enable flushing for sequential files, add a FLUSH statement on the channel, immediately following the OPEN.

On most Windows and UNIX systems, using system option #36 is faster than using the FLUSH statement. (On Windows it is significantly faster.)

On OpenVMS, if system option #36 is set, nonoutput files are not opened for deferred write or write behind caching.

Alternatively, you can use the FLUSH statement to flush files to disk programmatically. (See FLUSH for details.)

Note

The rpsutl program disables system option #36. This improves performance for those who have system option #36 set in their environment.