  We consider paths of a one-dimensional simple random walk conditioned to come
back to the origin after L steps (L an even integer). In the 'pinning model'
each path \eta has a weight \lambda^{N(\eta)}, where \lambda>0 and N(\eta) is
the number of zeros in \eta. When the paths are constrained to be non-negative,
the polymer is said to satisfy a hard-wall constraint. Such models are well
known to undergo a localization/delocalization transition as the pinning
strength \lambda is varied. In this paper we study a natural 'spin flip'
dynamics for these models and derive several estimates on its spectral gap and
mixing time. In particular, for the system with the wall we prove that
relaxation to equilibrium is always at least as fast as in the free case
(\lambda=1, no wall), where the gap and the mixing time are known to scale as
L^{-2} and L^2\log L, respectively. This improves considerably over previously
known results. For the system without the wall we show that the equilibrium
phase transition has a clear dynamical manifestation: for \lambda \geq 1 the
relaxation is again at least as fast as the diffusive free case, but in the
strictly delocalized phase (\lambda < 1) the gap is shown to be O(L^{-5/2}), up
to logarithmic corrections. As an application of our bounds, we prove stretched
exponential relaxation of local functions in the localized regime.
