Periodic oscillators, isochronous centers and resonance