Reputation: 1
I am a python novice, I gradually came to love python, but I'm not satisfied with its concurrent performance.
Multithreading is slow. Multi-process, slow loading, waste of resources.
So I thought, why not use Python. dll true multithreading.
It loads faster, runs faster, and save resources.
Moreover, An process inner share data more quickly and safely.
I am familiar with another scripting language, use this method. They can control each other, shared variables, but independent of each other, it is a true multi-threaded.
Who has similar experiences do, you're welcome to share.
Upvotes: 0
Views: 136
Reputation: 8910
Python (the language runtime, therefore the DLL) is architectured in such a way (global variables everywhere) that it's currently impossible to have more than one Python VM running in the same process.
So no, you can't do that (not in Python, at least -- Lua allows multiple independent VMs running in the same process).
And even if you could, to share data between threads (which is a bad idea to begin with, but that's another topic) without compromising the runtime's integrity, you need the GIL. That's why it exists in the first place.
Upvotes: 1