Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Thread safe equivalent of LINUX touch command

by space_monk (Chaplain)
on Nov 22, 2012 at 14:47 UTC ( #1005136=note: print w/ replies, xml ) Need Help??


in reply to Thread safe equivalent of LINUX touch command

Would you believe using File::Touch ? :-)

A Monk aims to give answers to those who have none, and to learn from those who know more.


Comment on Re: Thread safe equivalent of LINUX touch command
Re^2: Thread safe equivalent of LINUX touch command
by BrowserUk (Pope) on Nov 22, 2012 at 15:04 UTC

    There is no way that File::Touch is thread-safe(*).

    (*)I don't think the OP actually means "thread-safe" either, but that may become clearer in time.


    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.

    RIP Neil Armstrong

      Why not? AFAICT, if one thread touches a file then it will succeed, and if another thread tries to touch a file, then it too will succeed. There is nothing wrong in both threads succeeding and I don't think there is any lock issues apart from the actual creation of the file and/or setting of the modification date, which are probably operating/filesystem issues and should be thread safe in any event.
      A Monk aims to give answers to those who have none, and to learn from those who know more.
        Why not?

        Because the module modifies multiple pieces of data (times) in a non-atomic manner, with no synchronisation or locking.

        (Stop guessing and look at the **&*%$ code!)


        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.

        RIP Neil Armstrong

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-08-31 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls