Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

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

0
10 Posted

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

0
10

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.