Brian & John wrote:
BRIAN>>
As for msgfiles, I've always wondered about their value. Apart from the auto
delete function I have often wondered what they are really for.
For my app I just deleted the FLOCK/FUNLOCK from the programs.
Hopefully, I won't have any problems, but time will tell.
----
JIM>>
Value is "Interprocess communication". Message file usage is covered nicely here:
http://docs.hp.com/en/32650-90019/32650-90019.pdf
FLOCK/FUNLOCK provides some synchronization and recovery advantages. Really the latter is the most important aspect. Your need for recoverability really depends what the content of the message file record means to your applications. If its "go check inventory for part x" likely losing a record isn't too bad. If it is "we just shipped a product, now update the database and send the bill" losing it could be "bad".
The other consideration is how long you expect the data to reside in the file. If you use it like a local socket or pipe, only one or two records are likely at risk. If you're using it as a durable queuing mechanism, where say 100s or 1000s of records that persist for more than a few seconds you really need to use FLOCK/FUNLOCK or FCONTROL 2.
JOHN>>
We use msg files a lot to drive print jobs in batch from online progs. One problem is that if there is a sys-fail, or power fail or something that does not close the msg file properly, when you start up again, the file is damaged, but there are no errors returned, it just doesn't work. We have to purge the files and rebuild them before starting up the readers and writers.
----
JIM>> What your describing is likely related to doing not doing FCONTROL 2 or FLOCK/FUNLOCK on around FWRITE. Now I haven't looked closely at message files code since the early 90s but I'd say that this was kind of expected in 1989 running MPE V/E Vdelta5 on your Series 37 -- not something I would expect running 7.5 with the "Native Mode" message files (implemented in 5.0) though still, like any non-XM attached file, structural corruption is possible during system aborts. .
As per the IPC manual:
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/iX Intrinsics Reference Manual (32650-90028).
Jim
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|