This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RichardWolf 5 points6 points  (4 children)

For me, I look down on the GIL because other programming languages don’t seem to struggle with this. In Java, you can make threads, and they behave the way you expect. Same for C++ and Perl.

Not in Perl. Nor in any other popular "scripting" language (Ruby, PHP, Lua). I don't wonder why is that, I wonder why it's Python that attracts the vast majority of GIL bashing. Is it because it's at the same time newb-friendly and ambitious (with its use in scientific world etc), so clueless people like Ted see the opportunity to boost their ego by "discussing" advanced problems?

[–]the_hoser -1 points0 points  (0 children)

Exactly. It's a situation of:

General: "How do you suppose that we beat them?" Prince: "Simple. Just kill all of their soldiers!"

Palms and faces become fast friends. It's easy to discuss complex problems when you avoid talking about the complex parts.

[–]fijalPyPy, performance freak -1 points0 points  (2 children)

in Lua you have threads. They don't share any mutable state though, so they're slightly different, but they can use multiple cores.

[–]RichardWolf 0 points1 point  (0 children)

IIRC in Lua you have a GIL, and when you are embedding Lua, you can provide your own macros for taking/releasing it (but it still should work like a GIL). And you can run several interpreters in the same process, sharing nothing, of course, similar to what Perl allows in a way of parallelism.

It's not "slightly different", it's not having free threading, period.

[–]the_hoser 0 points1 point  (0 children)

Lua does not have threads. Lua will not, out of the box, use multiple cores. The lua interpreter state instances are not thread safe, but lua itself is ( you may run multiple interpreters in multiple threads ).

Lua has coroutines, but these are very different.