In Toronto, there were several powerless witnesses, and at least one person, apparently from an apartment overlooking the scene, videoed the killer as he was firing from the sidewalk below. In both cases, if a video taker had had a pistol instead of a smartphone, he could have engaged the killer, at least slowing him down, and saved lives or prevented serious bodily injuries.
The fact that the Toronto killer was apparently just a madman and a loser, as I called his kind in a previous post ("Mass Killings and the Economic Approach to Human Behavior"), is tragic but does not change the situation as far as saving lives is concerned.
Many people believe it is impossible that armed citizens could end or mitigate a mass shooting. In places like Toronto or Paris, they are right in the sense that carrying guns is a crime for ordinary citizens, so it is unlikely that one could legally and seriously challenge a killer in action. In Canada, if you have been permitted to own a handgun, it can only be carried in a locked case to an approved shooting club; it must otherwise be kept in your home, where it must be locked separate from ammunition, to make sure you don't use it in self-defense—which would be a crime anyway. It's even worse in the United Kingdom.