Pydevd's effect on python's multiprocessing & threading


What is the effect of's -- pydev's debugger used by Eclipsed and Pycahrm -- effect on python's multiprocessing & threading?

When I start my python server -- which uses both multiprocessing & threading -- without debugging, it crashes on startup with no helpful traceback. However, when I run with Pycharm's debugger, the process starts up and functions properly.

So what would be causing this difference in performance? Could it be serialization of Process() or imposing of some orders on Thread()?

Comment actions Permalink

Hi, pydevd patches both multiprocessing and threading indeed, see for details. Could you share a sample code which works with Run but fails under the debugger?

Comment actions Permalink

Thanks for your help!

I am afraid I can't because it is my company's server code I am developing.


Could you help me out navigate the code you have linked? Any details on which part of the code or which function does the "patching" would help.

Also, what is the change of behavior before vs after "patching"?


Thanks again :)

Comment actions Permalink

Hi Isaaclee! In fact, almost every function in this module does some patching. For example, we patch new process creation: and new threads creation:
Do you use `gevent` or any libraries which patch builtin modules? We do some tricks to save copy of non-patched libraries:
Do you use PyQt? If yes, we patch some pyqt modules as well:
Also we start our util threads for communicating with IDE and it can affect program behaviour as well:



Please sign in to leave a comment.