Forcing Records To Disc [ Interprocess Communication:Programmer's Guide ] MPE/iX 5.0 Documentation
Interprocess Communication:Programmer's Guide
Forcing Records To Disc
Message files reside primarily in buffers, and they can lose data in the
event of a system crash. For applications that must use message files
and must be "crash-proof," MPE XL provides a way to force the data to
disc.
This is done by using FCONTROL with a controlcode of 6. Either readers
or writers can call this intrinsic. It forces all buffers to be written
to disc and the disc file label to be updated. This causes several disc
I/Os and, therefore, takes a relatively long time. It must be done after
each FWRITE to be most effective, and even then there is a "window"
between the FWRITE and the FCONTROL during which a crash would cause the
record to be lost.
Remember that IPC is designed to be a fast, efficient means of passing
messages between processes. If the task the application is performing is
really event logging, and it must be highly crash-resistant, you should
consider using "circular files" or other files with FSETMODE. (FSETMODE
is ignored for message files.) For more information about FSETMODE,
refer to Accessing Files (32650-90017) and the MPE XL Intrinsics
Reference Manual (32650-90028).
MPE/iX 5.0 Documentation