Roland Mainz wrote:
> David Powell wrote:
>>      Instead of elaborate counting logic to limit the number of
>>      iterations of your while loops, just use 'for i in `seq 1 3`;
>>      do...'.
> 
> "seq" comes from the "SUNWgnu-coreutils" and requires a package
> dependicy in this case.

   Good point; seq may not be the greatest idea after all.

>>      ipf_get_lock is racy.  A simpler and more robust lock file can be
>>      created by creating a lockfile.$newpid that contains $newpid and
>>      attempting to ln $IPF_LOCK to your lockfile.
> 
> Erm... AFAIK the only portable way (portable across all types of
> filesystems, including NFS and DFS) is to use the atomic nature of
> "mkdir", e.g. use "mkdir" to create the lock and "rmdir" to release it,
> if "mkdir" fails then spin at this lock in incremetally larger time
> intervals (e.g 0.1, 0.2, 0.4, 0.8, 1.6 seconds etc.).

   In this case it only ever needs to work on tmpfs.

   Dave

Reply via email to