From Scientific American:
The human mind is a remarkable device. Nevertheless, it is not without limits. Recently, a growing body of research has focused on a particular mental limitation, which has to do with our ability to use a mental trait known as executive function. When you focus on a specific task for an extended period of time or choose to eat a salad instead of a piece of cake, you are flexing your executive function muscles. Both thought processes require conscious effort-you have to resist the temptation to let your mind wander or to indulge in the sweet dessert. It turns out, however, that use of executive function—a talent we all rely on throughout the day—draws upon a single resource of limited capacity in the brain. When this resource is exhausted by one activity, our mental capacity may be severely hindered in another, seemingly unrelated activity.
Imagine, for a moment, that you are facing a very difficult decision about which of two job offers to accept. One position offers good pay and job security, but is pretty mundane, whereas the other job is really interesting and offers reasonable pay, but has questionable job security. Clearly you can go about resolving the dilemma in many ways. Few people, however, would say that your decision should be affected or influenced by whether or not you resisted the urge to eat cookies prior to contemplating the job offers. A decade of psychology research suggests otherwise. Unrelated activities that tax the executive function have important lingering effects, and may disrupt your ability to make such an important decision. In other words, you might choose the wrong job because you didn’t eat a cookie.
More here.