On Mo, 09 Dez 2013, Nikolay Pavlov wrote:
> On Dec 9, 2013 10:05 PM, "Christian Brabandt" <[email protected]> wrote:
> >
> > Hi Thiago!
> >
> > On So, 08 Dez 2013, Thiago Padilha wrote:
> >
> > > About this issue of vim not responding, did you try to call the Stop()
> > > function of the test plugin? I added this function because python will
> > > never exit by itself unless the background thread is killed.
> >
> > No, and by the time I noticed, it was too late, Vim wouldn't respond
> > anymore. By attaching gdb to the process I saw, that Vim was hanging in
> > the python_end() function, so I think, you are right, python will never
> > exit unless the background thread is killed.
> >
> > I tried adding some pthread_exit function calls to the getout()
> > function, but this did not kill the python threads. I guess, this one
> > needs to be taken care of, so one does not leave a hanging Vim around.
>
> It maybe needs, but it is not a problem introduced by this patch: I used to
> deal with hangs due to powerline threads long before this patch and the
> best solutions we came up with are:
>
> 1. Use daemon threads. This means thread can be interrupted at exit in
> virtually any state which may be a problem in some use cases.
> 2. As our threads were mostly waiting we used an threading.Event instance
> to wait and not time.sleep. I.e. thread is either wakened by triggered
> event in which case it exits or it is wakened after specified timeout in
> which case it does its job.
>
> There are no standard ways to forcefully interrupt threads in Python so any
> program (plugin in our case) willing to use threads must write its own
> shutdown handlers. If I am not mistaking it is some design decision made on
> purpose.
Ah thanks for the info. I didn't know that and don't know python well
enough.
Best,
Christian
--
Der Aberglaube macht die Gottheit zum Götzen, und der
Götzendiener ist um so gefährlicher, weil er ein Schwärmer ist.
-- Johann Gottfried Herder (Palmbätter)
--
--
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/groups/opt_out.