Re: My way to check if a progam is already running
- From: Jan Panteltje <pNaonStpealmtje@xxxxxxxxx>
- Date: Thu, 21 Jun 2007 19:30:48 GMT
On a sunny day (Thu, 21 Jun 2007 12:12:20 -0700) it happened David Schwartz
<davids@xxxxxxxxxxxxx> wrote in
<1182453140.552495.60130@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>:
On Jun 21, 12:00 pm, Jan Panteltje <pNaonStpealm...@xxxxxxxxx> wrote:
Ok I see your point, but all this file locking is it not more complicated
then the 10 lines of code at the start of main() that I proposed?
Especially as many files (not just one) are involved?
Your solution has several defects.
1) It breaks if the name of the program is changed or the program is
accessed under another name.
Yes, not a normal user scenario, but could happen.
2) It breaks if another program is ever added that manipulates the
same data.
Sure, but that would make little sense, you do not just change postgres
files either, although you could as root.
3) It prohibits multiple operations of the same program, even if they
are on different data sets.
Yes, good point.
Locking the thing that must not change makes more logical sense.
DS
OK.
.
- References:
- My way to check if a progam is already running
- From: Jan Panteltje
- Re: My way to check if a progam is already running
- From: David Schwartz
- Re: My way to check if a progam is already running
- From: Jan Panteltje
- Re: My way to check if a progam is already running
- From: David Schwartz
- Re: My way to check if a progam is already running
- From: Jan Panteltje
- Re: My way to check if a progam is already running
- From: David Schwartz
- Re: My way to check if a progam is already running
- From: Jan Panteltje
- Re: My way to check if a progam is already running
- From: David Schwartz
- My way to check if a progam is already running
- Prev by Date: Re: My way to check if a progam is already running
- Next by Date: Re: Writing in .text section
- Previous by thread: Re: My way to check if a progam is already running
- Next by thread: Re: My way to check if a progam is already running
- Index(es):