Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Synchronizing multiple processes retrieving files out of shared directory

by graff (Chancellor)
on Mar 21, 2014 at 03:07 UTC ( #1079159=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Synchronizing multiple processes retrieving files out of shared directory
in thread Synchronizing multiple processes retrieving files out of shared directory

I think if you were to create sibling or sub-directories on the same disk volume as the one where the depository directory exists, then the perl-internal rename function will still work (and still be atomic in the same way). Each process could create its own sub- or sister directory, and the same logic should apply.


Comment on Re^3: Synchronizing multiple processes retrieving files out of shared directory
Download Code
Re^4: Synchronizing multiple processes retrieving files out of shared directory
by BrowserUk (Pope) on Mar 21, 2014 at 03:15 UTC
    if you were to create sibling or sub-directories on the same disk volume as the one where the depository directory exists, then the perl-internal rename function will still work (and still be atomic in the same way).

    Is that true for NFS mounted volumes?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      I suppose that would depend on what type of OS was being used to export the NFS volume. If it's a POSIX system, then it's using the same sort of OS-level system library call at the server, and given that old and new paths are on the same disk volume (we're just moving an inode out of one directory into another) it will be atomic, so the net result will be the same: no two separate processes will be able to rename the same file.

      That said, I just found a report that some (slightly) older versions of MacOSX were not actually using an atomic implementation of rename - but it seems that's been fixed.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (13)
As of 2014-12-22 09:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (114 votes), past polls