When a riot is in full swing, police will deploy in a square formation with a command team at the center. The command team is protected on all four sides by echelons of troops deployed in groups of 10 or 12 officers. There is also an arrest team at the center of the square.

This tactical unit is very mobile and able to adapt on the fly to changes in the situation. If a threat suddenly appears behind or to one side of the unit, then the echelon facing that direction is designated the front of the unit. The entire team can then change the direction it's facing without a lot of maneuvering. Also, the echelons can cover each other when the team moves to take advanced positions. If the unit is under attack, the whole team does not move together: One echelon moves while the others provide covering fire or an actual physical screen (with riot shields). Then another echelon moves up into position.
The echelon is not meant to be an impenetrable wall of cop. In fact, the riot squad often leaves an escape route to let rioters run past the squad. The officers can adopt a passive position, in which they spread out and leave several yards between each officer. The crowd can then easily filter through them. If a particularly violent group moves toward the officers or they spot specific suspects they want to arrest, they can quickly close the gaps and form a tight line.
As the unit moves forward into a crowd, it will prod and push at anyone who doesn't respond to requests to move away by the time the front echelon reaches them. If they still refuse to move, the unit continues moving forward, but the front echelon opens up and passes around the protesters. Once the protesters are inside the square, the unit stops, the front echelon reforms and the arrest team processes the rioters. When they're done, the unit can continue moving.
Police do not try to arrest every rioter. Their first targets are those who are leading the riot, because often the crowd will disperse without their leaders firing them up and encouraging them. All people who are spotted breaking a law are also targeted for arrest, especially if they injure or kill another person.
When it gets to the point where officers are actually in conflict with the rioters, the goal is still to disperse the crowd. A combination of advancing lines of officers and the use of noxious gas is used to direct the crowd in a certain direction or keep them away from a certain area. The crowd is never pinned down -- rioters are always given an escape route, since the whole point is to get them to run away.
COMMENT: In the 1960's there were only two cities that had White riots - Baltimore and Chicago. In Baltimore, over ten thousand White people would assemble at Patterson Park in the late 1960's and listen to pro-White speakers of the American Nazi Party, National State Rights Party, and Fighting American Nationalists*. Then about halfway through the rally thousands of listeners would start running north out of Patterson Park and beat up every black person they saw and killed any animal that was a pet of any black person. These White people were furious and were given the blacks a dose of their own medicine when the blacks would riot and invade White areas. Finally, the National Guard was brought in to later save the Blacks as thousands of armed White people were marching towards the Black areas and were going to force them to leave Baltimore City or kill every Black. This was the closest event to a Race War erupting in America (I was there). :)
Note* The Fighting American Nationalists was a front group set up by George Lincoln Rockwell who was the founder of the American Nazi Party. FAN was led by outspoken Baltimore union leader Charles Luthardt, Jr.

(above picture) Aerial view of Patterson Park in East Baltimore looking westward.