Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Aug 2001 03:21:53 -0400
From:      Jules Gilbert <jules@aasp.net>
To:        freebsd-questions@FreeBSD.ORG
Subject:   simple, stupid question...
Message-ID:  <3B762E90.E9DCF329@aasp.net>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------5E8084FD84849473F97B6709
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I am not a BSD whiz.

But I have a bunch of BSD systems which run all the time, and
occasionally one of them comes up with a bright idea 'he' wants to write
to a common file on one of the machines.  That way I can see it in the
morning.

Now, the thing is, it could happen that two machines attempt to do an
'fopen' concurrently, with the second argument being "ab", ie., append
binary.

All machines talk to a common directory (which exists on a single
machine) over an NFS based architecture.   These machines spend most of
their time thinking.  I was considering allowing each machine a small
slot of time, so that a deadlock on the common resource would be
impossible.

(First machine gets the first 10 seconds of a minute.  Second machine
gets the second 10 seconds of a minute, etc...)    These machines spend
most of their life thinking deep thoughts and only occasionally want to
write to this single file on one directory on one of the machines, so
the chance for collisions is small anyway...

Another way is to cause one machine to successfully open the file, write
out the brilliance, and the other machine to be told to try back in 30
seconds or a minute.

Is a file lock (flock.tar), the right choice here?  Years ago, I used a
machine which had two macros, "ENQUE" and "DEQUE", which by naming the
resource, assured me of serial access.  (The thing is, it didn't always
work.  This was the Xerox Sigma 9;  over 10,000 years ago...)

Also, any advantage to using text files here instead of binary files,
with respect to this problem?

Please copy your answer to:  jules@aasp.net and also me as:
jg@medg.lcs.mit.edu

By the way, THANK YOU BSD COMMUNITY  -- this is a wonderful system, and
while I am still learning how to best make use of it, I, along with
thousands of others living on this planet, thank you for your efforts.
This ingredient, among others, enables me to make a living without
having to use/touch/feel/see/think about MS and that whole ugly mess...



--------------5E8084FD84849473F97B6709
Content-Type: text/x-vcard; charset=us-ascii;
 name="jules.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Jules Gilbert
Content-Disposition: attachment;
 filename="jules.vcf"

begin:vcard 
n:Gilbert;Jules
x-mozilla-html:FALSE
adr:;;PO Box 3351;North Attleborough;MA;02761;
version:2.1
end:vcard

--------------5E8084FD84849473F97B6709--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B762E90.E9DCF329>