Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Check for another running instance of the same program

by dd-b (Monk)
on May 13, 2013 at 22:34 UTC ( #1033373=note: print w/replies, xml ) Need Help??


in reply to Check for another running instance of the same program

You can safely automate the deletion of the semaphore file by writing the PID to it, and having later programs check if the PID exists as a running process; if not it can delete the file and proceed.

Consider your requirements carefully; for example, does it apply to one system, or all systems that can access a particular NFS mount, or all systems on a built-in list with IP connectivity, or what exactly. These lead to very different solutions. Do you want to consider expanding it to "no more than n" copies running at once, or is the simple one at a time good?

  • Comment on Re: Check for another running instance of the same program

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1033373]
help
Chatterbox?
[Corion]: ambrus: Hehe ;) Yeah - such real life stuff is far more inconveniencing than wasting display area due to screen ratio problems :)
[ambrus]: Corion: yes, it's a bit tricky. you can try to adjust the slides live to cover only a part of the screen, but it's still hard.
[ambrus]: Corion: two very hard things about presentations I should try to work on if I have twenty times as much free time as in real life are:
[Corion]: That's why I like HTML - it makes it relatively easy to resize stuff. Resizing with Powerpoint is much harder, or at least, I remember it being that way
[ambrus]: (a) good sans serif fonts optimized for slides in a projector with coverage of the symbols needed for mathematical formulas in a sans serif font matching the text font well, and
[ambrus]: (b) a good presentation system that lets the presenter quickly interactively edit the slides live during a presentation, to combine the advantages of blackboard and overhead slide styles in modern tech
[Corion]: Heh - in university, I cheated on (a) by doing blackboard presentations using chalk. But those were 2 hour presentations, not quick/essential/ reduced presentations where you want to show something quick
[ambrus]: (either on just one screen or two screens). this is necessary because
[ambrus]: overhead slide plus blackboard is inconvenient because the lighting conditions are different and they require separate areas you can't quickly repartition, and typing on keyboard is faster and more convenient than writing on a blackboard
[Corion]: (b) would be cool. I've thought about this doing Pod editing, and even simply regenerating/live updating the browser makes things much more interactive

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (12)
As of 2017-09-26 10:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (293 votes). Check out past polls.

    Notices?