HP3000-L Archives

November 1997, 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:
Sat, 22 Nov 1997 15:02:05 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (30 lines)
Jim writes:

> In addition to the SHR;GMULTI Stan specified, I'd add LOCK and then use t=
> he
> EXCLUSIVE/
> UN-EXCLUSIVE verbs in the COBOL program(s) to logically lock the file whe=
> n
> writing =

The problem with this is that if the file is large (let's say, 1 MB or more),
the UNLOCK operation will kill your performance.  In general, there's
little reason to lock the file unless either of the following is true:

   1) a single process sometimes wants to append multiple records, and they
      should be contiguous in the file;

   2) a reader process wants to say "how many records are there", and then
      "go get them". ...   but even that doesn't require locking.


> to it.  I'd also add the FILE STATUS clause to the SELECT statement and
> interrogate =
> the file status after each I/O operation (OPEN/EXCLUSIVE/WRITE/...).  We =

Excellent suggestion!

--
Stan Sieler                                          [log in to unmask]
                                     http://www.allegro.com/sieler.html

ATOM RSS1 RSS2