home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / perl / 5383 < prev    next >
Encoding:
Text File  |  1992-08-19  |  1.8 KB  |  42 lines

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