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 avoiding work at the Monastery: (3)
As of 2018-06-19 01:27 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (111 votes). Check out past polls.