Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Why sourcing a file is not faster than doing a loop with eval, zle -N
- X-seq: zsh-users 22736
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Why sourcing a file is not faster than doing a loop with eval, zle -N
- Date: Mon, 19 Jun 2017 08:31:16 -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=wi4e2NQwQ0dZAswLQ4tduuJAI+C22UuAB2Jr2ox9KrM=; b=aKd5GgdEZ00tyhcyfBDV5PEPyHjLcN4s1vHmwyswxnLT0wghhE6YbpBccniMxWPKz7 IFemp1SC8SWG4FfY4m6qRFKMj7dc3TPsmtCC1kn5Bjzowwn2DytrPFRRVHgVZz4fzQUK WyPPs3Q3xzGI9axy2R8Rrc5BR/nisvX4OHPKcC1YZZpHMOSynPRTpUaAdWV42SdU7Hr7 VxayQnw9IizOswof5BfIvXr+hKgY8ltR3wlBRlvW1KkFkALTwnex/M3FWR9vli12+14V 99+yIN/gHkwOKWySTRSeaV7Xal6z2ZjXxuPphsa9WibuAgsfAcYhgNhvwXPJGc/oNCrq af2Q==
- In-reply-to: <20170619122413.GA9294@chaz.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <etPan.594513a8.516100cd.10b2e__10513.1716504276$1497699329$gmane$org@zdharma.org> <20170619122413.GA9294@chaz.gmail.com>
On Jun 19, 1:24pm, Stephane Chazelas wrote:
}
} There's probably scope for optimisation here, though I can't
} comment further as I don't know why that signal handling code is
} there in the first place.
rt_signprocmask should not be significantly more expensive than an
assignment to an integer.
The signal handling code is there because the shell MUST NOT respond
instantly to arbitrary signals while doing operations such as token
interpretation or or memory management -- the signal handlers might
themselves invoke shell commands/functions and many of those layers
are not safe for re-entrancy -- but it MUST respond to those signals
whenever it may be blocked for an unknown length of time, such as when
reading from a file descriptor.
Many years of "I can't interrupt my script when X" or "interrupting
my script when Y causes a crash" resulted in the current signal
paradigm. When the shell was first written, processors weren't fast
enough and process scheduling not well-threaded enough to expose a
lot of these issues, but the better our computers get the greater
the likelyhood of hitting an ever-smaller race condition window, so
those windows have to be aggressively closed.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author