Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: History file locking?



On Apr 10, 11:21pm, Zoltan Hidvegi wrote:
} Subject: Re: History file locking?
}
}    If the link fails, check the validity of the lock (the lock file should
}    contain the PID of the locking process) using kill(0, lock_pid).  If the
}    lock is invalid, remove it and repeat step 2.

That doesn't work when the competing processes are on two different
machines.  You can only reliably remove lock files by timing them out
based on the date of the file.  A process that wants to hang onto a
lock has to touch the lock file periodically to keep its date current.


-- 
Bart Schaefer                     Vice President, Technology, Z-Code Software
schaefer@xxxxxxxxxx                  Division of NCD Software Corporation
http://www.well.com/www/barts




Messages sorted by: Reverse Date, Date, Thread, Author