Subject: | |
From: | |
Reply To: | |
Date: | Tue, 24 Aug 1999 10:58:57 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Re:
> Rather than close and reopen the message file, try using FCONTROL 6. It
I was afraid someone would suggest this.
Let's look at the original comment:
> >- The message file is empty
> >- Process A opens the message file and writes 2 records to it.
> >- Process B asks for an FINFO('EOF',) on the message file and gets 0.
You have to ask yourself:
WHY IS PROCESS B CHECKING THE EOF?
It smacks of "polling" to me ... which is antithetical to message files!
I.e., I'd expect B to have a loop like:
top:
check EOF of file...
if not 0, read the record and handle it.
do other work;
go top;
However, this can be replaced by:
top:
fread (message file *WITHOUT BLOCK*)
if got record, handle it
do other work;
go top;
I.e., you can use FCONTROL (item 45) to tell MPE that you do *NOT* want
to block on an FREAD from the message file when there's no
data in it!
Ok...original problem solved ... back to the "I was afraid someone
would suggest this" comment.
Why should I be afraid?
Some of the worst performance problems I've encountered this year are
precisely because people are calling FCONTROL (6) on files! This results
in MPE doing a "post" operation, which can be ***EXTREMELY*** expensive on
large files on large memory machines. (Similarly, FLOCK/FUNLOCK can
cause bad problems.)
--
Stan Sieler [log in to unmask]
http://www.allegro.com/sieler/
|
|
|