4 ms·
"it’s often much easier for the programmer to write independent threads, each dedicated to its own part of the larger system." oh, if only it were true...
by nice_byte 7y ago
"it’s often much easier for the programmer to write independent threads, each dedicated to its own part of the larger system."
oh, if only it were true...
- csomar 7y agoYeah, that part really breaks down the credibility of the article.
- random_savv 7y agoThis was the point I stopped reading and came to HN to make this exact comment. Beat me to it!
- doubleunplussed 7y agoIm one of these people who reaches for threads to solve many a task, and that statement resonates for me. I've never understood why threads are considered so difficult, other than people not getting the message to sparingly share data other than via message-passing. Any time you need to do something asynchronously, things get trickier, but whether you keep it single threaded or not barely makes any difference. Race conditions exist in single threaded code too as soon as it is interacting with a network or the OS or anything that takes time and you don't want to block. It's not threads that are hard, it's the explosion of the state space of your program when you commit to accepting further user/network input whilst some task is ongoing, whether you implement that with threads or not.