Why is there no GIL in the Java Virtual Machine? Why does Python need one so bad?

后端 未结 5 722
青春惊慌失措
青春惊慌失措 2020-12-04 05:18

I\'m hoping someone can provide some insight as to what\'s fundamentally different about the Java Virtual Machine that allows it to implement threads nicely without the need

5条回答
  •  攒了一身酷
    2020-12-04 06:12

    Python lacks jit/aot and the time frame it was written at multithreaded processors didn't exist. Alternatively you could recompile everything in Julia lang which lacks GIL and gain some speed boost on your Python code. Also Jython kind of sucks it's slower than Cpython and Java. If you want to stick to Python consider using parallel plugins, you won't gain an instant speed boost but you can do parallel programming with the right plugin.

提交回复
热议问题