Article View: news.software.nn
Article #824Re: robust locking
From: Conor P. Cahill
Date: Wed, 29 Aug 1990 12:21
Date: Wed, 29 Aug 1990 12:21
22 lines
1883 bytes
1883 bytes
In article <2320@cirrusl.UUCP> dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) writes:
>A very simple mechanism can be used to ensure that such race conditions
>don't occur. Create a lock file that contains both process id and host
>name. If a second process wants to create the same lock, it checks any
>existing lock file. If the lock file exists, and the host name in it
>is that of the current host, then the process id in it can be tested to
>see if it is that of an existing process (and if not, that process
>crashed and the lock file can be superseded). But if the host name in
>the lock file is that of a different host, we refuse to supersede the
>lock.
But if you allow both processes to run on different hosts, you need to
modify the other parts of rn that deal with the .newsrc and other related
status/setup files. You will run into real problems when two processes
try to write out different .newsrc files.
--
Conor P. Cahill (703)430-9247 Virtual Technologies, Inc.,
uunet!virtech!cpcahil 46030 Manekin Plaza, Suite 160
Sterling, VA 22170
Technical Details
Message-ID:
<1990Aug29.122152.1600@virtech.uucp>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utstat!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!samsung!uunet!virtech!cpcahilReferences:
<2320@cirrusl.UUCP>Show Full Headers
Complete Article Headers
Message-ID: <1990Aug29.122152.1600@virtech.uucp> Subject: Re: robust locking Date: Wed, 29 Aug 1990 12:21:52 +0000 From: cpcahil@virtech.uucp (Conor P. Cahill) References: <2320@cirrusl.UUCP> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utstat!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!samsung!uunet!virtech!cpcahil Newsgroups: news.software.nn,comp.unix.questions Reply-To: cpcahil@virtech.UUCP (Conor P. Cahill) Organization: Virtual Technologies Inc., Sterling VA Lines: 21