Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

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

by theorbtwo (Prior)
on Feb 06, 2003 at 22:50 UTC ( [id://233308]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-16 04:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found