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:
"Keven Miller (rtt)" <[log in to unmask]>
Reply To:
Keven Miller (rtt)
Date:
Wed, 23 Jan 2008 16:58:31 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (46 lines)
Brian Donaldson wrote:
> 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.

Usually, well for me, the "message" consists of one record to
be written. So I don't see the need for(nor have I used) FLOCK, FUNLOCK
around msgfile FWRITEs and FREADs.

If the "message" consists of more than one record that you want to
FWRITE, meaning that readers need to do multiple FREADs to get the
message, locks could keep things in order,
placed around FWRITE -- when having multiple writers,
and around FREAD -- when having multiple readers.
But that design could have another set of problems.

Keven

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

ATOM RSS1 RSS2