Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No, because you can't kill a Python thread, but you can kill a process. That is a significant limitation to think about, especially when executing something long-running and CPU intensive such as large scientific computations.

If your thread gets stuck, the only recourse you will have is to kill the entire parent process.





Wow, I seriously question the quality of any project where this is a consideration. I would also strongly recommend you hire some better devs and rewrite that project in another language with better concurrency features. Java (or anything on the JVM) would lead that list but plenty of languages would be suitable.

Also, sharing memory between processes is very very very slow compared to sharing memory between threads.


The assumption is that they never share memory.

Any time you have an arbitrary independent task that can be started and then stopped by the user, you will need processes in Python.

Java is a lot better at concurrency and has a vast library for concurrency primitives like atomic operations (CAS etc.)

Python's strengths lies in its strong ecosystem and ease of use. Many times that overshadows the benefits of Java's competent concurrency features.


That plus you can have memory leaks when you run heavy stuff in threads...

If I worked on a project this shitty I sure wouldn't be telling people about it in public. Just the fact that you think this is advice other people need to hear is telling.

What advice? I'm not sure what you mean.

Do you mean that there is no valid use-case where you wish to interrupt a blocking thread due to I/O, for example?

Or maybe you think Python can do that. Maybe I'm wrong, but as far as I can tell Python is not good at doing that.

Perhaps my choice of word "kill" confused you, and in that case I should've picked better wording reflecting what I meant. Perhaps you thought I meant people should kill threads/processes instead of fixing buggy CPU-intensive tasks? That's certainly not what I meant.

You don't seem to be very charitable in how you interpret what I'm saying. Instead of a very vague comment, it would've been better if you'd have explained your concern, and given me a chance to understand you.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: