Ambien is the American tradename for zolpidem, a commonly used "hypnotic" sleeping tablet. In the UK, it is also known as Stilnoct. Sleeping pills are widely used in the UK.
Data from the NHS suggests that in England over 700,000 prescriptions for hypnotics are dispensed every month, with over 50,000 scripts for zolpidem.
Sleeping tablets work on certain nerve systems within the brain. Most sleeping pills work via the gamma-aminobutyric acid (GABA) nerve system to induce sleep.
Other commonly used hypnotics in the UK include zopiclone and benzodiazepines, such as nitrazepam (Mogadon), diazepam (Valium) and temazepam.
These drugs, like all other medicines, can have side effects. Historically, insomnia was treated with benzodiazepines.
But in 1988, the UK's Committee for the Safety of Medicines issued a warning that benzodiazepines should only be used to treat insomnia if it was severe or disabling. And due to the risk of withdrawal effects, they should be stopped gradually.
The so-called "z-drugs" (zolpidem, zopiclone and zaleplon) were originally marketed as safer, non-addictive alternatives to benzodiazepines in the 1990s.
But over time it has become apparent that they have similar problems to the earlier drugs. These problems include tolerance, dependence and drowsiness.
Sleeping tablets, like alcohol, are sedatives, and may cause confusion, drowsiness and falls. In older people, sedatives are associated with frailty.
Problems, such as drowsiness, can persist to the next day resulting in a "hangover" like effect. This can reduce alertness affecting the person's ability to drive or operate machinery.
Increasing awareness of this problem led the American (FDA) and European (EMEA) regulators to issue warnings in 2013 and 2014. The European regulator recommended that patients should be warned that such medicines may increase the risk of road traffic accidents.
Zolpidem in particular appears to be associated with bizarre and compulsive behaviour that is unexpected and difficult to predict.
These bizarre behaviours include sleep-eating and sleep-driving. The patient may appear to be awake, but unaware of their actions and may carry out routine activities such as driving, household tasks, cooking and eating.
The next day the person may have little or no memory of their actions. Some patients have also reported sleep sex (having sex while asleep).
A psychotic-like state has also been reported with zolpidem, with patients reporting hearing voices or seeing things that aren't there (auditory and visual hallucinations), as well as feeling paralysed, and very real and sometimes violent nightmares.
Worryingly, because these behaviours are accompanied by memory loss, it is likely that they are underreported and we don't know how common they are.
Even more worryingly, the z-drugs are increasingly abused. Zopiclone, the most commonly prescribed z-drug, has a street name (Zim-zim or Zimmers) and a street price of about £1 per tablet.
The drug's potential for abuse is now thought to be higher than previously believed. One user reported: "Zimmers are really addictive, and the rattle is about five times worse than the rattle from gear [heroin]."
The z-drugs, such as zolpidem, were originally introduced as safer, non-addictive alternatives to benzodiazepines such as Valium. But it appears that they cause similar problems.
Hangover, addiction and dependence have all been reported. Zolpidem in particular appears to be associated with bizarre inappropriate behaviours that people can't remember.
Sanofi, the company that manufactures Ambien, said in a statement following Barr's tweet: "While all pharmaceutical treatments have side effects, racism is not a known side effect of any Sanofi medication."