Subject: | |
From: | |
Reply To: | Keven Miller (rtt) |
Date: | Wed, 23 Jan 2008 16:58:31 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
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 *
|
|
|