• ALERT
    link
    fedilink
    English
    32 days ago

    how can they relaunch with the new binary without relaunching the binary? what’s behind this Linux magic?

    • @[email protected]
      link
      fedilink
      English
      10
      edit-2
      2 days ago

      It doesn’t launch the new binary at all. When the current process wants to create a new process, instead of doing fork+exec (which launches the new binary and wreaks havoc because versions now don’t match), it simply tells the ForkServer (a different process running the old binary) to fork (split) itself.

      Chromium also does this; they call their equivalent to ForkServer the zygote process and this article explains it really well.

      • ALERT
        link
        fedilink
        English
        12 days ago

        yes, and I understood nothing as a stupid Windows user

        • @[email protected]
          link
          fedilink
          4
          edit-2
          2 days ago

          Basically instead of launching completely new processes for each tab, which uses the (now updated/different) binary on disk, it uses a small secondary process that stays running the whole time the browser is open, and new processes are forked from that one, which makes them all use the same in-memory copy of the old process even after the program is updated.

          This only works on *nix because you can’t overwrite binaries on Windows that are in use… but Linux keeps the old binary in memory the whole time, so it doesn’t care if you replace it, as it won’t be used until you restart the program.

          So it doesn’t actually update anything at all while it’s running.

        • @[email protected]
          link
          fedilink
          32 days ago

          It uses the same mechanism as PS3 did with the DLC. All new versions of firefox are in the binary you download today, their features are unlocked periodically.

          /s