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

Re: Patch 7.3.786

Expand Messages
  • Bram Moolenaar
    ... That doesn t look right, it would access pygilstate before setting it. -- If your life is a hard drive, Christ can be your backup. /// Bram Moolenaar --
    Message 1 of 7 , Jan 30, 2013
    • 0 Attachment
      Ken Takata wrote:

      > Bram Moolenaar wrote:
      >
      > > Patch 7.3.786
      > > Problem: Python threads don't run in the background (issue 103).
      > > Solution: Move the statements to manipulate thread state.
      > > Files: src/if_python.c
      >
      > There is the same problem with if_python3.
      > Following patch seems to fix this (but I'm not sure):
      >
      > --- a/src/if_python3.c
      > +++ b/src/if_python3.c
      > @@ -734,6 +734,8 @@
      > * as the system trace hook), will be lost between invocations of
      > * Python code. */
      > PyEval_InitThreads();
      > + /* The first python thread is vim's, release the lock. */
      > + PyGILState_Release(pygilstate);
      > pygilstate = PyGILState_Ensure();
      >
      > #ifdef DYNAMIC_PYTHON3

      That doesn't look right, it would access pygilstate before setting it.

      --
      If your life is a hard drive,
      Christ can be your backup.

      /// Bram Moolenaar -- Bram@... -- 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 vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Ken Takata
      ... Hmm, but the same can be said of if_python.c. pygilstate would be accessed in Python_SaveThread() because PY_CAN_RECURSE is normally defined. Using
      Message 2 of 7 , Jan 31, 2013
      • 0 Attachment
        2013/01/31 Thu 5:56:41 UTC+9 Bram Moolenaar wrote:

        > That doesn't look right, it would access pygilstate before setting it.

        Hmm, but the same can be said of if_python.c. pygilstate would be
        accessed in Python_SaveThread() because PY_CAN_RECURSE is normally defined.

        Using PyEval_SaveThread() to release the GIL seems good.
        I checked the attached patch with Python 2.7 and 3.3 on Win7.
        Both background threads and system trace seem to work well.

        Thanks,
        Ken Takata

        --
        --
        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.
      • Bram Moolenaar
        ... The implementaiton for Python 2 was supposed to work. I would appreciate a few people to try this out on different environments. If I don t hear about
        Message 3 of 7 , Feb 1, 2013
        • 0 Attachment
          Ken Takata wrote:

          > 2013/01/31 Thu 5:56:41 UTC+9 Bram Moolenaar wrote:
          >
          > > That doesn't look right, it would access pygilstate before setting it.
          >
          > Hmm, but the same can be said of if_python.c. pygilstate would be
          > accessed in Python_SaveThread() because PY_CAN_RECURSE is normally defined.
          >
          > Using PyEval_SaveThread() to release the GIL seems good.
          > I checked the attached patch with Python 2.7 and 3.3 on Win7.
          > Both background threads and system trace seem to work well.

          The implementaiton for Python 2 was supposed to work.

          I would appreciate a few people to try this out on different
          environments. If I don't hear about problems I'll include this patch.

          --
          ARTHUR: Listen, old crone! Unless you tell us where we can buy a shrubbery,
          my friend and I will ... we will say "Ni!"
          CRONE: Do your worst!
          "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

          /// Bram Moolenaar -- Bram@... -- 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 vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Ken Takata
          Hi, ... No one has reported about my patch :-( BTW, I wrote tests for the patches 7.3.691, 698 and 768. I found that the patch 7.3.768 breaks 7.3.691. I also
          Message 4 of 7 , Feb 13, 2013
          • 0 Attachment
            Hi,

            2013/02/02 Sat 4:23:57 UTC+9 Bram Moolenaar wrote:

            > The implementaiton for Python 2 was supposed to work.
            >
            > I would appreciate a few people to try this out on different
            > environments. If I don't hear about problems I'll include this patch.

            No one has reported about my patch :-(

            BTW, I wrote tests for the patches 7.3.691, 698 and 768.
            I found that the patch 7.3.768 breaks 7.3.691.
            I also tested my patches with Python 2.7 and 3.2 on Linux and Cygwin.
            Both the background thread and sys.settrace worked fine.

            Regards,
            Ken Takata

            --
            --
            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.
          • Bram Moolenaar
            ... Thanks. I verified the test breaks without including your patch of two weeks ago. I ll send it out now. -- Software is like sex... it s better when it s
            Message 5 of 7 , Feb 13, 2013
            • 0 Attachment
              Ken Takata wrote:

              > 2013/02/02 Sat 4:23:57 UTC+9 Bram Moolenaar wrote:
              >
              > > The implementaiton for Python 2 was supposed to work.
              > >
              > > I would appreciate a few people to try this out on different
              > > environments. If I don't hear about problems I'll include this patch.
              >
              > No one has reported about my patch :-(
              >
              > BTW, I wrote tests for the patches 7.3.691, 698 and 768.
              > I found that the patch 7.3.768 breaks 7.3.691.
              > I also tested my patches with Python 2.7 and 3.2 on Linux and Cygwin.
              > Both the background thread and sys.settrace worked fine.

              Thanks. I verified the test breaks without including your patch of two
              weeks ago. I'll send it out now.

              --
              "Software is like sex... it's better when it's free."
              -- Linus Torvalds, initiator of the free Linux OS
              Makes me wonder what FSF stands for...?

              /// Bram Moolenaar -- Bram@... -- 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 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.