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

I'm sure many people don't think this applies to them because they don't use threads. However, in the modern day, replace "thread" with "process" and "memory" with "database", and many web applications have very similar problems. They just never actually manifest because of the small number of requests per second.


No, the problems of threads don't carry over to processes, what you just said is exactly wrong and misunderstands the issues involved. Databases have transactions and processes don't share memory, those solve the problem with threading which is shared non transactional memory.


Transactions lock and conflict with each other, so the metaphor holds fairly closely though not completely equivalent of course


Yes but these are recoverable states whereas threads suffer from partial reads in the middle of updates resulting in undefined unpredictable behavior. It's not a good metaphor to compare threads to processes as they suffer from vastly different failure modes and problems and are quite normally contrasted to each other as different solutions to concurrency problems.


the reason people don't want to use threads is because they're afraid of having to understand race conditions. At that level, "you will have to understand race conditions no matter what" is the wisdom I derive from this particular metaphor.




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

Search: