Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A fast outputting program can halt the gvim with conque #37

Closed
GoogleCodeExporter opened this issue Feb 25, 2016 · 3 comments
Closed

A fast outputting program can halt the gvim with conque #37

GoogleCodeExporter opened this issue Feb 25, 2016 · 3 comments

Comments

@GoogleCodeExporter
Copy link

I wrote a program which has a busy output.
I run it in the shell open by conque in gvim
Then the whole gvim lost response, until I kill -9 the program.
htop shows that the gvim was taking 100% of the CPU, however, 
the program itself is not taking much CPU.


Original issue reported on code.google.com by nai....@gmail.com on 24 Dec 2010 at 7:40

@GoogleCodeExporter
Copy link
Author

I've seen this happen a few times before, I think when greping a bunch of one 
line, many thousand character files.

I'll take a look.

Original comment by nicora...@gmail.com on 24 Dec 2010 at 11:09

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

A fix has been checked into trunk, and will go out with the next release. If 
you want it before then, make the following changes in 
.vim/autoload/conque_term/conque_subprocess.py


Index: autoload/conque_term/conque_subprocess.py
===================================================================
--- autoload/conque_term/conque_subprocess.py   (revision 435)
+++ autoload/conque_term/conque_subprocess.py   (working copy)
@@ -120,6 +120,7 @@

         output = ''
         read_timeout = float(timeout) / 1000
+        read_ct = 0

         try:
             # read from fd until no more output
@@ -129,12 +130,19 @@
                 lines = ''
                 for s_fd in s_read:
                     try:
-                        lines = os.read(self.fd, 32)
+                        # increase read buffer so huge reads don't slow down
+                        if read_ct < 10:
+                            lines = os.read(self.fd, 32)
+                        elif read_ct < 50:
+                            lines = os.read(self.fd, 512)
+                        else:
+                            lines = os.read(self.fd, 2048)
+                        read_ct += 1
                     except:
                         pass
                     output = output + lines.decode('utf-8')

-                if lines == '':
+                if lines == '' or read_ct > 100:
                     break
         except:
             pass


Original comment by nicora...@gmail.com on 26 Dec 2010 at 4:16

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

:) thanks!

Original comment by nai....@gmail.com on 27 Dec 2010 at 6:50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant