Re:When the Tab Comes Due: Challenges in the Cost Structure ...
by gwmnxnp_516a on Sunday May 09, 2021 @11:22PM
(#27102379)
Modern browsers uses multi-process, a process for each tab due to security and reliability reasons. If a single tab crashes, the all other tabs will not be crashed. In addition, unlike threads, processes are isolated from each other since they do not share the same address space, which is another line of defense. This multi-process approach could not be needed if an entire web browser, such as Firefox, was written in a memory safe language like Rust.
[ Parent
| on HN ]
Re:When the Tab Comes Due: Challenges in the Cost Structure ...
by compressedgas on Monday May 10, 2021 @10:09PM
(#27113388)
Even with Rust the browser would still need multiple processes because Rust provides no way to catch a panic. The way to handle panics in Rust is to run the code in its own process and then to handle the failure of that process.
Re:When the Tab Comes Due: Challenges in the Cost Structure ...
by steveklabnik on Monday May 10, 2021 @11:28PM
(#27113917)
We do provide a way to catch a panic https://doc.rust-lang.org/stable/std/panic/fn.catch_unwind.h...
It's not considered generally idiomatic as an error handling strategy, but it does exist if it's needed.