Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Ideas for implementing pShell

by elwarren (Curate)
on Apr 04, 2004 at 16:08 UTC ( #342481=note: print w/replies, xml ) Need Help??

in reply to Ideas for implementing pShell

A good way to do this would be to borrow a page from unix add some simple lockfile methods to your code. Choose a common directory for your programs, maybe "c:\pvoice\lock\" When you launch a program it should create a file and possibly put it's process id inside. When the program exits, remove the file. When programs startup they should check for their respective lockfile and exit if its found. Need to kill or stop a process, open it's lockfile and use it's pid. If a process crashes then the lockfile will exist but the process id will not, the crash can be recorded and a new instance fired up.

This could be implemented in each of your programs without a requirment of the minimanager. This is how many unix programs manage use of the serial ports without having complex interprocess communications.

I'm sure there's some sort of module out there to do this already. Searches for either lockfile or process management on cpan should turn something up.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://342481]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2018-03-20 16:40 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (255 votes). Check out past polls.