Menu

#862 PyDev blocks UI thread

open
nobody
None
5
2009-03-19
2009-02-23
No

PyDev runs several long running tasks in the UI thread. This blocks the UI (Eclipse "hangs").

So far, I've identified these operations which make Eclipse unresponsive:

- Starting the Python interpreter
- Code completion

Please wrap them in a Job (see http://www.eclipse.org/articles/Article-Concurrency/jobs-api.html\) and schedule them for background processing.

Discussion

  • Fabio Zadrozny

    Fabio Zadrozny - 2009-03-04

    Hi Aaron,

    Most of the Pydev things are already in jobs... Now, on to the points you passed:

    - Code completion: this one can't really be set as a job in the Pydev level (eclipse provides for an interface which pydev implements: IContentAssistProcessor which expects the results to be readily available -- not through the execution of a job). In this level, what can be done is making the code-completion faster (profiles with that in mind are done from time-to-time or when a specific slow case is reported)

    - Starting the python interpreter: do you mean in the pydev preferences, after selecting a new interpreter and pressing OK?

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2009-03-04
    • status: open --> pending
     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending --> closed
     
  • Aaron Optimizer Digulla

    • status: closed --> open
     
  • Aaron Optimizer Digulla

    Some background info: I had a Python install which was broken; so the interpreter couldn't be started. This lead to a lot of hickups because PyDev tried to start it over and over again.

    So my guess is that you have some central place which you call for context info. In that place, you check whether the interpreter runs. If it doesn't run, you start it. This happens synchronously. I suggest to start it in the background *once* and return immediately with "Interpreter not yet available".

    If the start fails, set a flag and don't try to start it again unless the user invokes a special "start interpreter" menu or something.