How does a Canal Lock Work?

A canal lock is sort of like a bath tub for seafaring vessels in that the water levels can be controlled. The vessel is lifted into a holding area or sort of a passing lane and is then diverted into the other ocean.