Our thoughts have a limited bandwidth; we can only fully process a few items in mind simultaneously. To compensate, the brain developed attention, the ability to select information relevant to the current task, while filtering out the rest. Therefore, by understanding the neural mechanisms of attention we hope to understand a core component of cognition. Here, we review our recent investigations of the neural mechanisms underlying the control of visual attention in frontal and parietal cortex. This includes the observation that the neural mechanisms that shift attention were synchronized to 25 Hz oscillatory brain rhythms, with each shift in attention falling within a single cycle of the oscillation. We generalize these findings to present a hypothesis that cognition relies on neural mechanisms that operate in discrete, periodic computations, as reflected in ongoing oscillations. We discuss the advantages of the model, experimental support, and make several testable hypotheses.