James McCoy wrote:
> On Thu, Jun 09, 2016 at 10:53:16PM +0200, Bram Moolenaar wrote:
> >
> > Danek Duvall wrote:
> > > The thought I have was to do the classic thing where the signal handler
> > > sets a global flag and returns immediately. For the majority of the cases
> > > I've seen, the loop in RealWaitForChar is where the signal hits anyway, so
> > > checking for that flag there would be easy, and it could call
> > > preserve_exit() and exit quickly and sanely, even if it can't do a lot of
> > > cleanup. The simple (and incomplete) attached patch works for my
> > > testcase.
> > > Other places would be harder to handle, but maybe they don't happen enough
> > > to be worth it.
> >
> > This might work better when actually waiting for a character, but it
> > makes Vim completely ignore the signal when it's looping somewhere.
> > Which would be the reason to send it a signal in the first place.
>
> Vim already performs checks for interrupts ({fast,line}_breakcheck).
> Having flags set for certain signals (including SIGINT) and checking
> that instead of performing a select() every time those functions are
> called would vastly improve the performance of places where those are
> called in a relatively tight loop.
>
> An example of this I've been meaning to bring up is:
>
> $ ctags -R /usr/include
> $ vim
> :echo taglist('a')
>
> This takes minutes to complete, nearly all of which is spent in select()
> calls.
That's needed to check for characters that don't cause a signal.
And the signal is needed in case there is no call to breakcheck (not all
possible locations to loop do that).
So this covers 99% of the situations. Dropping one or the other will
reduce the coverage of being able to interrupt Vim.
--
hundred-and-one symptoms of being an internet addict:
86. E-mail Deficiency Depression (EDD) forces you to e-mail yourself.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.