Hacker News new | past | comments | ask | show | jobs | submit login

Im 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.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: