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

后端 未结 5 721
青春惊慌失措
青春惊慌失措 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:13

    There is a comment down below in this blog post http://www.grouplens.org/node/244 that hints at the reason why it was so easy dispense with a GIL for IronPython or Jython, it is that CPython uses reference counting whereas the other 2 VMs have garbage collectors.

    The exact mechanics of why this is so I don't get, but it does sounds like a plausible reason.

提交回复
热议问题