Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^6: locking over the network (NFSLock)

by rovf (Priest)
on Feb 02, 2011 at 14:31 UTC ( [id://885745]=note: print w/replies, xml ) Need Help??


in reply to Re^5: locking over the network (NFSLock)
in thread locking over the network

Maybe I indeed need more practice reading, or at least improve my English. The first paragraph says:

Program based of concept of hard linking of files being atomic across NFS. This concept was mentioned in Mail::Box::Locker (which was originally presented in Mail::Folder::Maildir). Some routine flow is taken from there -- particularly the idea of creating a random local file, hard linking a common file to the local file, and then checking the nlink status. Some ideologies were not complete (uncache mechanism, shared locking) and some coding was even incorrect (wrong stat index). File::NFSLock was written to be light, generic, and fast.

I can read here: "Program based of concept ... being atomic across NFS". I have understood this as being a class which is used to do locking on NFS. Please explain where I misinterpreted this text.

Also, I am curious to know in what respect using NFSLock is better than my original solution. For example, is the code which I posted unreliable? If so, this would certainly be an argument to try NFSLock.
-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^7: locking over the network (NFSLock)
by DrWhy (Chaplain) on May 04, 2011 at 22:07 UTC
    The docs of File::NFSLock are not the clearest I've ever read. However, with some background knowledge it's possible to surmise that this module can be used on local filesystems too. The problem with most file locking schemes when used on NFS is that they depend on certain operations which are atomic for local FS's actually being atomic -- but on NFS many of these operations are not atomic. So to introduce the concept by saying it works because something on NFS is atomic, it's a pretty safe assumption that that operation is atomic on local FS's as well and so the locking mechanism will also work there.

    --DrWhy

    "If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://885745]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (None)
    As of 2025-03-21 07:12 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      When you first encountered Perl, which feature amazed you the most?










      Results (63 votes). Check out past polls.