HP3000-L Archives

January 2008, 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:
Brian Donaldson <[log in to unmask]>
Reply To:
Brian Donaldson <[log in to unmask]>
Date:
Thu, 24 Jan 2008 10:26:43 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (98 lines)
G'Day, Mate:

Sorry to hear about Heath Ledger. Far too young to be leaving us.
Those Rx meds will kill you for sure if you don't stick to the quack 
recommended dosage.


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.

Keven came up with a very interesting scenario where you may need the 
FLOCK/FUNLOCK around the FWRITE and FREAD if you are writing a
number of msgfile records that are considered a single logical transaction.

Brian. 


On Thu, 24 Jan 2008 15:49:54 +1100, John Pitman <[log in to unmask]> 
wrote:

>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.
>jp
>
>-----Original Message-----
>From: HP-3000 Systems Discussion [mailto:[log in to unmask]] On 
Behalf Of Brian Donaldson
>Sent: Thursday, 24 January 2008 9:54 AM
>To: [log in to unmask]
>Subject: Re: [HP3000-L] FLOCK/FWRITE/FUNLOCK to Message File Question
>
><<snip>>
>
>So, if you want your FREAD call to wait until after the FWRITE's FUNLOCK, 
the
>FREAD must also surrounded by an FLOCK/FUNLOCK pair. (A big WARNING
>though - if you have a race condition and the reader gets the lock first, the
>read will wait until it has data to read and the writer may be blocked, never
>having the opportunity to write that data.)
>
><<end snip>>
>
>I do an FCONTROL before the FREAD setting the FREAD timeout to 5 seconds
>so that this hanging problem won't happen.
>
>
>Scenario:
>
>Program 1:
>
>FLOCK
>FWRITE
>FUNLOCK
>
>
>Program 2 user #S1:
>
>FCONTROL (set timeout to 5 seconds)
>FLOCK
>FREAD (no record, wait 5 seconds then exit if timeout)
>if record read successfully then process data and auto delete msgfile record
>FUNLOCK
>
>Program 2 user #S2:
>
>FCONTROL (set timeout to 5 seconds)
>FLOCK
>FREAD (no record, wait 5 seconds then exit if timeout)
>if record read successfully then process data and auto delete msgfile record
>FUNLOCK
>
>
>Not really sure if the FLOCK/FUNLOCK is really necessary. It seemed to
>be at the time but it may very well not be.
>
>I think I'll just remove the FLOCK/FUNLOCK. That should make life a whole
>lot simpler, I hope.
>
>Thanks to all who replied.
>
>
>Brian.
>
>* To join/leave the list, search archives, change list settings, *
>* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
>
>* To join/leave the list, search archives, change list settings, *
>* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2