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

Re: fc -ap -R stalls when called from sched



On Sep 11, 10:58am, Sebastian Gniazdowski wrote:
}
} I call function __convey_on_period_passed() from sched +1 mechanism.
} 
}     # Read input using history mechanism
}     local -a commands
}     () { fc -ap -R "$datafile"; commands=( ${history[@]} ) }
} 
} Shell stalls for ~10 seconds, then continues with data correctly read.

The most likely thing going on is that lockhistfile() is spinning on
repeated attempts to have exclusive access to the file.

} Removing anonymous function doesn't help. Doing normal load via
} commands=( "${(@f)"$(<$datafile)"}" ) does help.

Since opening for read with redirection doesn't attempt to lock, this
would make sense in relation to the previous hypothesis.

} The plugin is for: a) assigning IDs and names to Zsh sessions b) doing
} "zconvey -n Devel vim ~/.zshrc" to fire up command on Zsh session
} named "Devel" (not implemented yet, thus a manual print -rl -- is used
} to fill IO file).

If you're going to read the file with "fc -R" why not write it also with
"fc -W" or "fc -A"?  Then the history mechanism would handle all of your
locking and you wouldn't need "zsystem flock" or its workaround.



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