in reply to flock -- and indefinite wait

Well... <embarassed grin> after reading past paragraph two in the flock perldoc (5.6.0) I found the answer to much of the above.

Then I stumbled across tilly's node about "flock feedback". That answered much of the rest of the above questions.

I'm still puzzled by the proliferation of loop code sans the "| LOCK_NB".

And, I'm still killing run-a-muck perl scripts by hand.

So if you can overlook my previous inability to get past paragraph two in the perldoc, maybe someone will have a clue about how to do the clean-up of scripts left dangling by an escaping browser.

Thanks Claude

Replies are listed 'Best First'.
Re: Re: flock -- and indefinite wait
by perlplexer (Hermit) on Jul 23, 2003 at 14:55 UTC
    "...maybe someone will have a clue about how to do the clean-up of scripts left dangling by an escaping browser."

    Well, do you know what causes them to "dangle"? Are they all waiting on a lock? If so, tilly's node should provide a good solution to your problem; i.e., using LOCK_NB and retrying.
    Alternatively, you can use alarm(). Signal handling is pretty reliable if you're careful; i.e., instead of dumping loads of potentially non-reentrant code into the handler itself, just set a flag and handle the condition in your main program.

    --perlplexer