Read histogram from TFile while actively writing to it (with example)

Then I’m confused by the suggestion made here. Why was this even suggested as a solution if that process isn’t allowed? What would be the correct way to handle this?