Can you emulate threads in the interpreter instead of relying on an OS-specific thread implementation?

0
Posted

Can you emulate threads in the interpreter instead of relying on an OS-specific thread implementation?

0

1: Unfortunately, the interpreter pushes at least one C stack frame for each Python stack frame. Also, extensions can call back into Python at almost random moments. Therefore, a complete threads implementation requires thread support for C. Answer 2: Fortunately, there is Stackless Python, which has a completely redesigned interpreter loop that avoids the C stack. It’s still experimental but looks very promising. Although it is binary compatible with standard Python, it’s still unclear whether Stackless will make it into the core — maybe it’s just too revolutionary.

Related Questions