3 ms·
It's as useful advice as: "Should one use arms when swimming? NO! Because that can make you swim faster, and that's dangerous because you'll get to swim where
by acqq 6y ago
It's as useful advice as:
"Should one use arms when swimming? NO! Because that can make you swim faster, and that's dangerous because you'll get to swim where you wouldn't with the arms bound on your back."
Explanation: if you haven't learned and understood enough of computer architecture, computer programming, how the operating systems work, how the libraries you use work etc, yes, please, don't use threads. Most with that background, who do simply lack the required knowledge to use them.
And if you have knowledge and experience and there is a real problem having a reasonable solution when threads are used, you don't need a site like above.
Moreover, one can acquire both knowledge and experience. But, that process, I'm quite sure, does not depend on clicking on a site having the content like the above and believing it.
- ygra 6y agoMany languages and their standard libraries also have useful high-level abstractions over threads and thread-pools that are much safer to use. Currently whenever I see a manually-managed actual Thread instance in a program I'm wondering whether that's really necessary and for things where, say, you just want to start a somewhat long-running computation and get notified about its completion and result, while your UI stays responsive, I wouldn't voluntarily use a bare thread for that.
- acqq 6y agoI never questioned that, I of course use the abstractions myself, when convenient. Where have you received an impression that I promote "actual Thread instance" or the use of any specific language construct explicitly? I haven't written anything like that. However, even if the abstractions exist, that doesn't mean that understanding the lower levels, or what is abstracted and what not, is not necessary. Those who don't know what actually happens often have wrong expectations, and design their code based on them. Then only later it turns out that the expectations were simply wrong, and not that the OS or the libraries or the languages made some false promises. Often, the most interesting information is not what are the abstraction primitives but what from lower levels is not covered by these abstraction primitives, or how these abstraction primitives map to which lower levels.
- ygra 6y agoOh no, this wasn't a rebuttal; it was merely an addendum to the points you've made. The site seemed in some places to advocate against not using threading at all, for reasons that have more to do with how easy it is to shoot yourself in the toes with a bare thread, while the abstractions on top of it are usually much easier to handle.