Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: fc -ap -R stalls when called from sched
- X-seq: zsh-workers 39285
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: fc -ap -R stalls when called from sched
- Date: Sun, 11 Sep 2016 17:17:23 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=mqte/aKeOsRFxKHJPdZdL3Bw+nDpriaGs4B9LN4Kqu8=; b=Gjvr0v2Z0PAGoKcdryrfIkP/28d+uizTfbZrv5p0BS0fj0dAZ+PsRC791tpCFj/N4L zFZmUCkPK1n6HNXqb4jsHDdlH81woRJr89fj609NbW0uzWyKQqItDyY6fjRmnjM+fchS Gi/UQ0Wes57cWSpO3plfJZUSSZPtG3RX/Xlz8/ww/TxQInVP8YRIwiGCdYYXN6/9OUJz 2L1S29Wz6DRv7ubQ/BNab4TgH6fCGYIoYRaNg1MKCwJdIbyQylWCvhsaVNWDmSJEwLYS 5DHFi50NffOxADpjMFCTej1Y3bto++zog/TC/QA8n8MtRe9xWaK9C56dAgayX2X7hOHj MhmA==
- In-reply-to: <CAKc7PVDNXK2jnDxVXLUvLeqM7zgsU+ssZ-wfboXxNqyOynrmeQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVDNXK2jnDxVXLUvLeqM7zgsU+ssZ-wfboXxNqyOynrmeQ@mail.gmail.com>
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