zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: fc -ap -R stalls when called from sched
Date: Sun, 11 Sep 2016 17:17:23 -0700	[thread overview]
Message-ID: <160911171723.ZM21053@torch.brasslantern.com> (raw)
In-Reply-To: <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.


      parent reply	other threads:[~2016-09-12  0:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-11  8:58 Sebastian Gniazdowski
2016-09-11  9:01 ` Sebastian Gniazdowski
2016-09-11  9:14   ` Sebastian Gniazdowski
2016-09-12  0:17 ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=160911171723.ZM21053@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).