Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^4: Ensuring only one copy of a perl script is running at a time

by polettix (Vicar)
on Dec 24, 2006 at 02:49 UTC ( #591487=note: print w/replies, xml ) Need Help??


in reply to Re^3: Ensuring only one copy of a perl script is running at a time
in thread Ensuring only one copy of a perl script is running at a time

Citing tye:
It sounds like it is time for you to update your computer science knowledge by learning about race conditions.
When a question/issue raises up, it's likely that more than one person will try to answer. This is not even a shared CPU environment: it's true concurrency. But humans tend to have personal ways of doing stuff: there's the verbose one, the one that uses only two fingers to write on the keyboard, the one that answers to the telephone... and in the end you have that many answers overlap each other, even if their times are quite different. It's like a race... a race condition :)

In this case, I'd also enhance your answer to the OP giving enough evidence of the need to use flock (and marking such a modification clearly, in order to keep the following answers "meaningful"): the fact that your personal script used flock was not entirely evident :)

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://591487]
help
Chatterbox?
[ambrus]: erix: that one actually sucks. these days people should get rid of the old notion that TeX is the only thing you can use for decent mathematics writing, because MS Office and LibreOffice have reached the
[ambrus]: level where people can more easily write as good mathematical papers in them as the people who write bad LaTeX papers usually write.
[ambrus]: Yes, for like the first twenty of its years, TeX was basically the only system that allowed you to write decent maths papers, and C++ and PHP were programming languages that sucked, etc. But times change and people have to accept that.
Discipulus bad people + good tool < normal people + decent tool
[Discipulus]: php does not suck anymore?
[ambrus]: Discipulus: I'm not sure, but it certainly doesn't suck as much as it's used to. it's like C++, it sucks because people still recursively learn from twenty year old PHP examples,
[ambrus]: and they try to use the obsolete features that PHP has to support only for compatibility with old scripts. C++ and PHP both have the problem that people can't forget the past, because when they google "PHP" plus the problme they want to solve, they find b
[ambrus]: ad code examples.
[ambrus]: I'm not trying to recommend PHP, but I think it has way too bad a name because of its past.

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2017-09-26 11:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (293 votes). Check out past polls.

    Notices?