[Discuss] Python programming questtion
Kent Borg
kentborg at borg.org
Sat Jul 4 15:56:07 EDT 2026
On 7/4/26 11:04 AM, Jerry Feldman wrote:
> I have a python GTK app that uses paramiko to log into a remote host and
> perform a few tasks that populate a class. These work perfectly BUT...
> I do get a 'python not responding' dialog.
> Before I refactor the code,
> Would I be better off using the threading or multiprocess module.
Slightly off topic…?
I once wrote a Python program that used Python multithreading and
managed to easily peg all four cores on the computer. But everyone knows
that isn't possible with Python because the global interpreter lock
(GIL) keeps Python from doing more than one thing at a time and makes
Python terrible at multi-threading.
I got away with it because the heaving lifting was all in opencv,
running compiled C/C++ (I presume), and it mostly didn't need to lock
the interpreter.
To the extent your Python threads are not executing Python but are in
imports implemented in a real, compiled language, outside of Python's
world, Python multithreading works great! To the extent your code is
*in* Python, not so much.
This was a long time ago, I would hope that Python has gotten better
since, but I am pretty sure the GIL is still out there making
multithreading terrible..
I don't know how helpful that is, alas,
-kb
More information about the Discuss
mailing list