4 ms·
The GIL has considerable benefits: I don’t have to worry about whether Python functions are thread-safe. Thread-based parallelism is hard to get right, and give
by goerz 8y ago
The GIL has considerable benefits: I don’t have to worry about whether Python functions are thread-safe. Thread-based parallelism is hard to get right, and given the number of workarounds, Python’s GIL is a total non-issue.
- jashmatthews 8y ago> The GIL has considerable benefits: I don’t have to worry about whether Python functions are thread-safe. Hold on, the GIL doesn't make Python automatically thread-safe! You can still have classic data races as the VM can pause and resume two threads writing to the same variable.
- goerz 8y agoCan you elaborate on that? Is there a blog post somewhere that illustrates the problem you're talking about? I was under the assumption that Python interpreters run single-threaded.
- devxpy 8y agoSmall correction: It makes the _implementation_ thread-safe. It also simplifies a lot of CPython code, making it a lot easier to maintain.