When an individual performs several tasks simultaneously, processing resources must be allocated to different brain systems to produce energy for neurons to fire. Following the evidence from neuroscience, we model the brain as an organization in which a coordinator allocates limited resources to the brain systems responsible for the different tasks. Systems are privately informed about the amount of resources necessary to perform their task and compete to obtain the resources. The coordinator arbitrates the demands while satisfying the resource constraint. We show that the optimal mechanism is to impose to each system with privately known needs a cap in resources that depends negatively on the amount of resources requested by the other system. This allocation can be implemented using a biologically plausible mechanism. Finally, we provide some implications of our theory: (i) performance is inversely related to the difficulty of the task and can be flawless for sufficiently simple tasks, (ii) the dynamic allocation rule exhibits inertia (current allocations are increasing in past needs), and (iii) different cognitive tasks are performed by different systems only if the tasks are sufficiently important.