If you’ve ever heard that Python is bad at threading, the cause is Python’s global interpreter lock, the GIL for short. With computer core speed not growing as fast as it used to, most computers these days compensate by adding multiple CPU cores, allowing multiple threads to run computations in parallel. And even without multiple cores, you can have concurrency, for example one thread waiting on disk while another runs code on the CPU. The ability to use parallelism can be critical to scaling your application—or making your data processing finish faster.

Unfortunately, in many cases your code can only run one thread at a time, due to Python’s global interpreter lock, the GIL for short. Other times it can run multiple threads just fine—it all depends on the specific usage patterns…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help