Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why there are not any real lightweight threads for python?

I'm new to Python and seems that the multiprocessing and threads module are not very interesting and suffer from the same problems such as threads in Perl. Is there a technical reason why the interpreter can't use lightweight threads such as posix threads to make an efficient thread implementation that really runs on several cores?

like image 263
piotr Avatar asked Dec 16 '09 12:12

piotr


1 Answers

It is using POSIX threads. The problem is the GIL.

Note that the GIL is not part of the Python spec --- it's part of the CPython reference implementation. Jython, for example, does not suffer from this problem.

That said, looked into Stackless ?

like image 189
Alex Brasetvik Avatar answered Oct 19 '22 16:10

Alex Brasetvik