in reply to Locking/unlocking program execution using a queue
(This solution may not scale well if there are many directories, but you'll be able to adapt to your case)
Create a fifo (mknod -p fifoname) and have a script continuosly read from it. If there's nothing in the FIFO the process won't consume resources.
Programs to run are simply inserted in the FIFO as strings; in the cron job, you substitute the script execution with a write into the FIFO, i.e. you prepend echo and append a redirection to the FIFO. The reader script will extract and execute them, via some eval mechanism, or fork(), or whatever you like.
There are tons of theme variations, but I think this should give you the idea.
Flavio
Don't fool yourself.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Locking/unlocking program execution using a queue
by RazorbladeBidet (Friar) on Mar 30, 2005 at 15:31 UTC | |
by polettix (Vicar) on Mar 30, 2005 at 15:47 UTC | |
by Akhasha (Scribe) on Mar 31, 2005 at 02:18 UTC | |
by Anonymous Monk on Apr 01, 2005 at 17:48 UTC |