this post was submitted on 26 Mar 2025
520 points (96.9% liked)
Programmer Humor
22083 readers
410 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
If what you said were true, wouldn't it make a lot more sense for OP to be making a joke about how even if the source includes multi threading, all his extra cores are wasted? And make your original comment suggesting a coding issue instead of a language issue pretty misleading?
But what you said is not correct. I just did a dumb little test
And then
ps -efT | grep python
and sure enough that python process has 4 threads. If you want to be even more certain of it you canstrace -e clone,clone3 python ./threadtest.py
and see that it is makingclone3
syscalls.~~Now do computation in those threads and realize that they all wait on the GIL giving you single core performance on computation and multi threaded performance on io.~~
Correct, which is why before I had said
Isn't that what threading is? Concurrency always happens on single core. Parallelism is when separate threads are running on different cores. Either way, while the post is meant to be humorous, understanding the difference is what prevents people from picking up the topic. It's really not difficult. Most reasons to bypass the GIL are IO bound, meaning using threading is perfectly fine. If things ran on multiple cores by default it would be a nightmare with race conditions.
I haven't heard of that being what threading is, but that threading is about shared resourcing and memory space and not any special relationship with the scheduler.
Per the wiki:
https://en.m.wikipedia.org/wiki/Thread_(computing)
I also think you might be misunderstanding the relationship between concurrency and parallelism; they are not mutually exclusive. Something can be concurrent through parallelism, as the wiki page has (emphasis mine):
https://en.m.wikipedia.org/wiki/Concurrency_(computer_science)