HP3000-L Archives

August 1999, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Stan Sieler <[log in to unmask]>
Reply To:
Stan Sieler <[log in to unmask]>
Date:
Tue, 24 Aug 1999 10:58:57 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (54 lines)
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/

ATOM RSS1 RSS2