4 ms·
Firefox is a house of cards, because all those billion tabs are sharing a single process and they all need to cooperate perfectly.
by mtdewcmu 12y ago
Firefox is a house of cards, because all those billion tabs are sharing a single process and they all need to cooperate perfectly.
- Dewie 12y agoIn what ways do the tabs need to cooperate/interact?
- pessimizer 12y agoThey have to share the same thread. If one blocks, they all block.
- mtdewcmu 12y agoThere are many threads, but threads are not isolated by the OS to the same extent as processes; hence, their fates are all intertwined. The user can't kill one misbehaving thread, and even if you could, you couldn't expect the program to be stable afterward.
- coryrc 12y agoHeh, I have attached to the process, went to the stuck thread, went up a few frames, and told it to return. Never did recover, as expected :) But before it restored all your tabs it was worth a shot at saving the state.
- mtdewcmu 12y agoYou'd have to know the source code quite intimately to answer that. My hunch is that when it slows down, what you'd see under the covers is a tangled mess of locks and some kind of leaking resource(s). If the tabs were more isolated, you'd be able to at least kill the ones most responsible and the others would survive. Chrome consciously chose to isolate tabs in separate processes; having more explicit separation probably discourages tangled dependency chains and that might be the best explanation for why, even though you could, you don't have to resort to actually killing processes that often.