3 ms·
The smartest engineers in the world are not smart enough to write bug free multithreaded code.
by baggy_trough 6y ago
The smartest engineers in the world are not smart enough to write bug free multithreaded code.
- WJW 6y agoNobody is smart enough to write bug free code, but at least some companies have the smarts to fix their code and blog about how they did it.
- robotresearcher 6y agoYou're right but the parent's point is that multithreaded code with shared objects is known to be particularly difficult to do perfectly, and hard work to debug. It's so difficult that the rational strategy may be to architect to avoid it. We will have bugs, but not those bugs. Those bugs stink.
- baggy_trough 6y agomay > definitely is, whenever possible.
- fanf2 6y agoThis is the kind of multithreading bug that Rust’s borrow checker can prevent: the compiler would have complained that the background task and the main request handler have write access to the env object at the same time, which is not allowed.
- astrange 6y agoWriting your website in PHP would also have prevented it, because its amateur process per request design is actually the best way to do things, scales well, and has the right security properties. Having an app server that can have requests from different users in the same memory space is a mistake.
- baggy_trough 6y agoYou can also run Ruby's unicorn or puma servers as a single-threaded process cluster.
- joshdifabio 6y agoPHP might move away from this safe approach with fibers, which are about to be added to the language. https://externals.io/message/113419#113555 https://externals.io/message/113419#113555
- trav4225 6y agoIt depends on the complexity.