Rifles and pistols have long been made to shoot light charges that do not need the breech securely locked during the discharge, and are perfectly safe to use.
The original automatic pistol operated as follows:
The discharge drives the mechanism back against a spring at the same time that it blows open the breech, which the recoil spring then closes, inserting a fresh cartridge. The spent cartridge is blown with some force sideways out of a slot at the side of the mechanism, so that it may not hit the shooter in the face.
In some makes of pistol, the cartridge is not blown out but merely dropped out.
With a suitable charge the breech-closing mechanism can be made heavy enough for its inertia to keep the breech closed sufficiently long after the discharge.
When it comes to such heavy charges that it is necessary to keep the breech closed till the force of the explosion is spent, the difficulty of making a safe automatic firearm begins.
With a military full-charge rifle this has hardly yet been arrived at, hence the delay in its being used for military purposes, but it seems as if the problem is on the point of being solved.
For the comparatively weak recoil of a pistol, this does not apply. There are several perfectly safe pistols in use, and there is no danger in using any of the well-known makes.
Some makes of automatic firearms, instead of using the recoil for operating the mechanism, have a small tube alongside the barrel, which communicates by a minute hole with the bore of the barrel near its muzzle.
The breech does not open till the bullet is just passing out of the barrel, past the hole into the tube, and therefore the expansion of the gas of the explosion loses its force.