Jim writes:
> Anyway, here's our situation: We have a program that is run by several
> users to write a record to a message file. Before the program writes
> to the message file, it attempts to lock another file (which has a
> sequential number that is read and incremented). If the file is
> "busy" (locked by another user), then the program is supposed to call
> the PAUSE intrinsic for 4 seconds and try again. The program "hangs"
Not a PAUSE comment, but here's how we did that for one application:
Change the "serial number file" into a message file, and
pre-fill it with enough serial numbers to last a day or two
(or longer).
Change your code that does:
flock
fread
increment
fupdate (or fwritedir)
funlock
to
fread
Optionally, add a low priority background process whose only
purpose in life is:
while true do
increment counter;
fwrite to message file;
SS