Trying to do two things at once is usually a recipe for doing both badly, according to a long line of research. We’re slower and less accurate when we try to juggle two things. Experts came to believe that there wasn’t much that could be done about this, so most of the advice in HBR has been to avoid multitasking as much as possible.

But if giving up multitasking isn’t an option, a new study published in in Psychological Science offers some hope: your ability to multitask may depend on whether you were trained to do the two tasks separately or simultaneously.

The first thing to know about multitasking is that the word is a misnomer. You’re not really doing two things at once so much as rapidly switching back and forth between them. That switching process is mentally taxing — your brain has to recall the instructions for how to do one task, then put them aside and recall the instructions for how to do the other, then repeat the whole thing again — and so the result is poor performance on both.

Cognitive scientists at Brown have now added an interesting wrinkle by drawing a connection between multitasking and the research on learning and memory. Previous studies have demonstrated that context affects our ability to remember information or perform a task. A famous study in 1975 taught divers a list of vocabulary words while underwater. Later, when asked to recall their meaning, the divers could recall more words underwater than on land. What if something similar were true for multitasking?

The Brown researchers, Joo-Hyun Song and Patrick Bédard, performed an experiment where participants completed “visuomotor” exercises on a computer — moving a stylus around on a screen based on visual prompts. Some of the participants were just moving the cursor in response to a series of dots on the screen. Some were asked to do that, and to follow a series of letters that appeared intermittently at the same time. In other words, the second group was asked to multitask.

Later, the participants were asked to do the exercises again, except some of the single-taskers were asked to multitask and some of the multitaskers were asked to just do the single task. Surprisingly, the multitaskers didn’t do any worse this time around, on average, than those performing the single task.

Instead, just like the divers recalling words underwater, what mattered was consistent context. Those who performed under the same conditions both times did better than those whose conditions changed. So the multitaskers who started out doing two things at once were able to recall how to complete the task better than the multitaskers who were later asked to just do one thing, or the single-taskers who were later asked to do two.

In a second experiment, the researchers found that it didn’t necessarily matter what the second task even was. This time multitaskers were asked, the second time around, to try a totally new task, along with a practiced one, and performed just as well.

While there’s no guarantee that what works in the lab will hold true in the office, these results suggest the possibility that our ability to juggle tasks and recall information depends on the context in which we learned those things in the first place. If the research does apply to office work, it’s most likely to tasks that require motor skills, like typing, since that’s what the experiment measured. If you’re typing while listening to a conference call, maybe you’re less likely to make mistakes if you were equally distracted when you originally learned to type.

The best advice is still to avoid multitasking whenever possible. But for those who have to do it, consistent context matters. If you’re going to be multitasking when forced to recall information or perform a task, it may be better to practice multitasking when you learn it in the first place.