Loading ...
Sorry, an error occurred while loading the content.

Re: Issue 103 in vim: Python thread are not running in background

Expand Messages
  • vim@...
    Comment #2 on issue 103 by zyx....@gmail.com: Python thread are not running in background http://code.google.com/p/vim/issues/detail?id=103 Similar to the one
    Message 1 of 18 , Jan 15, 2013
    • 0 Attachment
      Comment #2 on issue 103 by zyx....@...: Python thread are not running
      in background
      http://code.google.com/p/vim/issues/detail?id=103

      Similar to the one you linked in
      http://marc.info/?l=vim&m=110029576819749&w=2. And it in fact runs fine
      here (vim-7.3.762, amd64).

      --
      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
    • vim@...
      Comment #7 on issue 103 by degu...@gmail.com: Python thread are not running in background http://code.google.com/p/vim/issues/detail?id=103 I did find the
      Message 2 of 18 , Jan 15, 2013
      • 0 Attachment
        Comment #7 on issue 103 by degu...@...: Python thread are not running
        in background
        http://code.google.com/p/vim/issues/detail?id=103

        I did find the culprit!

        Reverting commit 7f10daa706bb solves the issue (the test-case is correclty
        incrementing the variable in background). It also prevents vim to compile
        when PY_CAN_RECURSE is not set.

        It doesn't solve the problem of non-terminating threads, but that's also
        another issue.

        --
        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
      • vim@...
        Comment #8 on issue 103 by zyx....@gmail.com: Python thread are not running in background http://code.google.com/p/vim/issues/detail?id=103 ... Nope. It is
        Message 3 of 18 , Jan 16, 2013
        • 0 Attachment
          Comment #8 on issue 103 by zyx....@...: Python thread are not running
          in background
          http://code.google.com/p/vim/issues/detail?id=103

          > On which platform are you testing? I would guess Windows since
          > pythoninterp=dynamic seems to only be available on this platform.

          Nope. It is available anywhere, but pythoninterp=dynamic is the only choice
          if you want to have both python and python3 support in one binary. It is
          Gentoo on amd64. And Ubuntu ARM (efika MX smartbook modification of Ubuntu,
          stripped of almost any package that was there in a fresh installation).

          > Reverting commit 7f10daa706bb solves the issue (the test-case is
          > correclty incrementing the variable in background). It also prevents vim
          > to compile when PY_CAN_RECURSE is not set.

          Now when you mentioned it I remember I saw some (threading?) problems with
          this commit on vim-dev. Did not came to my mind as I forgot about threads
          as they are not working on ARM and are not forcefully terminatable. This is
          also why I suggest processes to anyone wanting to use threads.

          Though reverting commit is not an option: it itself is solving some issues.
          Better to check why I have the code running correctly and you do not.

          --
          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
        • vim@...
          Comment #9 on issue 103 by degu...@gmail.com: Python thread are not running in background http://code.google.com/p/vim/issues/detail?id=103 Maybe the bug
          Message 4 of 18 , Jan 16, 2013
          • 0 Attachment
            Comment #9 on issue 103 by degu...@...: Python thread are not running
            in background
            http://code.google.com/p/vim/issues/detail?id=103

            Maybe the bug depend on python's version? Mine is 2.7.3.

            And yes I know that reverting the culprit commit is not really an option:
            it does fix a bug. However, the fix may not be the correct one. Is there a
            test-case for that bug to see if we can fix it in another way?

            --
            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
          • vim@...
            Comment #10 on issue 103 by degu...@gmail.com: Python thread are not running in background http://code.google.com/p/vim/issues/detail?id=103 Hum, I m wondering
            Message 5 of 18 , Jan 16, 2013
            • 0 Attachment
              Comment #10 on issue 103 by degu...@...: Python thread are not
              running in background
              http://code.google.com/p/vim/issues/detail?id=103

              Hum, I'm wondering whether the GIL is not taken too much time.

              If we read the description of PyEval_InitThreads(), it says "it is
              guaranteed that the lock has been created and that the calling thread has
              acquired it". Calling PyGILState_Ensure() also takes the GIL. Which means
              that at init time, the GIL is taken 2 times, but only released once in
              if_python.c:767 (by calling Python_SaveThread()). Since the GIL is never
              released, that would explain why the background threads are not allowed to
              run.

              --
              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
            • vim@...
              Comment #11 on issue 103 by degu...@gmail.com: Python thread are not running in background http://code.google.com/p/vim/issues/detail?id=103 Changing the
              Message 6 of 18 , Jan 16, 2013
              • 0 Attachment
                Comment #11 on issue 103 by degu...@...: Python thread are not
                running in background
                http://code.google.com/p/vim/issues/detail?id=103

                Changing the initial value of pygilstate to PyGILState_LOCKED may be the
                solution? (I'm only supposing since I don't know how the initial bug could
                be triggered)

                --
                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
              • vim@...
                Updates: Status: Accepted Comment #12 on issue 103 by lech.lor...@gmail.com: Python thread are not running in background
                Message 7 of 18 , Jan 17, 2013
                • 0 Attachment
                  Updates:
                  Status: Accepted

                  Comment #12 on issue 103 by lech.lor...@...: Python thread are not
                  running in background
                  http://code.google.com/p/vim/issues/detail?id=103

                  I also noticed the problem when using clang_complete. Last time closing Vim
                  took 2 hours to complete! I'm using Vim 7.3.762 under Cygwin with Python
                  2.6.8.

                  --
                  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
                • vim@...
                  Comment #13 on issue 103 by jonathan...@gmail.com: Python thread are not running in background http://code.google.com/p/vim/issues/detail?id=103 Here is how I
                  Message 8 of 18 , Jan 25, 2013
                  • 0 Attachment
                    Comment #13 on issue 103 by jonathan...@...: Python thread are not
                    running in background
                    http://code.google.com/p/vim/issues/detail?id=103

                    Here is how I patched my source.

                    Attachments:
                    vim-python-thread-issue.patch 974 bytes

                    --
                    --
                    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
                  • vim@...
                    Comment #14 on issue 103 by degu...@gmail.com: Python thread are not running in background http://code.google.com/p/vim/issues/detail?id=103 That patch seems
                    Message 9 of 18 , Jan 29, 2013
                    • 0 Attachment
                      Comment #14 on issue 103 by degu...@...: Python thread are not
                      running in background
                      http://code.google.com/p/vim/issues/detail?id=103

                      That patch seems to fix the issue indeed.

                      --
                      --
                      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 vim_dev+unsubscribe@....
                      For more options, visit https://groups.google.com/groups/opt_out.
                    • vim@...
                      Updates: Status: Fixed Comment #15 on issue 103 by brammool...@gmail.com: Python thread are not running in background
                      Message 10 of 18 , Jan 30, 2013
                      • 0 Attachment
                        Updates:
                        Status: Fixed

                        Comment #15 on issue 103 by brammool...@...: Python thread are not
                        running in background
                        http://code.google.com/p/vim/issues/detail?id=103

                        The patch is included as 7.3.786.
                        Please reopen this issue if it didn't fix the problem.

                        --
                        --
                        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 vim_dev+unsubscribe@....
                        For more options, visit https://groups.google.com/groups/opt_out.
                      Your message has been successfully submitted and would be delivered to recipients shortly.