Re: My way to check if a progam is already running



Jan Panteltje <pNaonStpealmtje@xxxxxxxxx> writes:

On Sat, 23 Jun 2007 12:05:34 +0200 it happened Michal Nazarewicz
<mina86@xxxxxxx> wrote in <871wg3j89d.fsf@xxxxxxxxxxxxxxxx>:

With the above code I think it is not possible to start two instances in
such a way that both will continue running. The worst case is that they
both will abort. (It's still a bug.)

I still don't see why you don't want to lock a file at the start and
unlock it when program terminates. It's way simpler operation:

Yes, but then you have 2 GUI up for example,

??? How locking a file lock differs from getting number of applications
with given name? Simply replace your checking routine with what I wrote
and you have the same functionality but more portable and without any
bugs.

--
Best regards, _ _
.o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michal "mina86" Nazarewicz (o o)
ooo +--<mina86*tlen.pl>---<jid:mina86*chrome.pl>--ooO--(_)--Ooo--
.



Relevant Pages

  • Re: WaitForSingleObject freezes application
    ... Mike Gleason Jr Couturier wrote: ... > Finally here is my abort button actions: ... There's yet another bug in your code. ...
    (microsoft.public.vc.mfc)
  • Re: Listbox state and binding
    ... Since the bug is somewhere in the Tk core C code ... I am not able to propose a fix right now (my C knowledge is ... for the current state in the binding command first and abort the action ...
    (comp.lang.tcl)
  • The Unit 4-4-06
    ... device of comm breakdown on various levels. ... So instead of an innocent sounding "abort mission" signal being ... these guys have a pre-arranged codeword for bug out but no one ...
    (rec.arts.tv)
  • Re: Abolute path of argv[0]
    ... Jan Panteltje writes: ... >>the mistakes of others. ... Have you heard of the word "bug", in the context of software? ...
    (comp.os.linux.development.apps)
  • Re: Can malloc ever really fail?
    ... >> mallocmay return a null pointer ... So you think that xmallocshould abort the program (on systems ... > with a parameter of 0 as a bug. ... I perceive terminating the program because of a call to ...
    (comp.lang.c)