in reply to Re: Determining if self is already running under WinNT/2000
in thread Determining if self is already running under WinNT/2000

Win32 has PIDs as usual, though they tend to be more annoying numbers, since they're really pointers into a kernel memory structure. IOW, you can use all the standard methods for dealing with this.

You can also use a Mutex kernel-object, which is the standard win32 way of dealing with it. See Win32::Mutex. This has the advantage of not creating files, and not having problems with the lockfiles of dead processes staying around. OTOH, it doesn't have the transparency that lockfiles/pidfiles do, and it's inherently nonportable.


Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

  • Comment on Re: Re: Determining if self is already running under WinNT/2000