If the only response you can think of while reacting to violence in an unsettled crowd is carrying a gun and shooting people then you shouldn't be allowed to get out of your home. If you have to be in such a situation, you should not be allowed to carry arms and be trained in other methods of dealing with the situation and defending yourself. Most countries in the world work exactly like that without any issue. Just because the US is still living in the cowboy era where people draw a gun and shoot at someone because they were staring at them doesn't mean that's the standard we should accept or condone.
The reason you aren't allowed to carry a firearm openly where you live is precisely to avoid any situation like this and guess what, it works. And even in a lot of countries where violence is commonplace (like mine) if someone fires a gun in a riot or an unsettled situation, they are the first one to accused, and they aren't defended by people saying they had no other way to defend themselves. You know, like anyone with an iota of common sense and respect for human life would do.