5 ms·
it's _still_ essentially the same switch(opcode) based interpreter it was 20 years ago. no threading, no super instructions, no jitting, nothing. https://githu
by toolslive 6y ago
it's _still_ essentially the same switch(opcode) based interpreter it was 20 years ago. no threading, no super instructions, no jitting, nothing.
https://github.com/python/cpython/blob/master/Python/ceval.c#L1568 https://github.com/python/cpython/blob/master/Python/ceval.c...
- jashmatthews 6y agoDirect threading is in here https://github.com/python/cpython/blob/0564aafb71a153dd0aca4b9266dfae9336a4f2cb/Python/ceval.c#L990 https://github.com/python/cpython/blob/0564aafb71a153dd0aca4...
- toolslive 6y agoha! you're right. so some optimizations did happen while I wasn't looking ;)
- FartyMcFarter 6y ago> no threading, CPython does use threads (on Linux, it spawns one pthread per Python thread). However it also has a lock (the infamous GIL) that prevents those threads from interpreting Python code simultaneously.
- PeCaN 6y agoNot that. https://en.wikipedia.org/wiki/Threaded_code https://en.wikipedia.org/wiki/Threaded_code It's an interpreter implementation technique.