Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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.

HTH

In reply to Re: Ideas for implementing pShell by elwarren
in thread Ideas for implementing pShell by Jouke

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-03-29 02:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found