home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!snorkelwacker.mit.edu!usc!cs.utexas.edu!convex!convex!tchrist
- From: Tom Christiansen <tchrist@convex.COM>
- Subject: Re: open(lockfile, O_CREAT|O_WRONLY|O_EXCL, 0444) in perl?
- Originator: tchrist@pixel.convex.com
- Sender: usenet@news.eng.convex.com (news access account)
- Message-ID: <1992Aug19.124414.5341@news.eng.convex.com>
- Date: Wed, 19 Aug 1992 12:44:14 GMT
- Reply-To: tchrist@convex.COM (Tom Christiansen)
- References: <1992Aug19.082244.61337@ilx018.intel.com>
- Nntp-Posting-Host: pixel.convex.com
- Organization: CONVEX Realtime Development, Colorado Springs, CO
- Keywords: lock file
- X-Disclaimer: This message was written by a user at CONVEX Computer
- Corp. The opinions expressed are those of the user and
- not necessarily those of CONVEX.
- Lines: 23
-
- From the keyboard of steed@ilws14 (Ze'ev Shtadler):
- :I'd like to have a perl script that uses a lock file as a semaphore
- :across NFS of diverse hardware platforms and operating systems. I was
- :told, this is the only "real safe" way to ensure exclusive access
- :between processes on different machines (I know this does not apply to
- :processes not bothering to lock :-). Can that be done from within
- :perl?
-
- Yes, we need a 3-arg form of open for perl. No, we don't have one yet.
- You *could* play with syscall(), I suppose, and make it work.
-
- However, you've been misled regarding the safety of the cited lockfile
- strategy over NFS. Neither creation nor deletion are atomic there.
- You should use lockf, who'll use the lockd, who'll likely hang your
- kernel.:-( Sigh. You might try the link strategy, but I don't know
- whether that's guaranteed either.
-
- --tom
- --
- Tom Christiansen tchrist@convex.com convex!tchrist
-
- Whenever people agree with me I always feel I must be wrong.
- --Oscar Wilde
-