A membrane oxygenator is a device used to add oxygen to, and remove carbon dioxide from the blood. It can be used in two principal modes: to imitate the function of the lungs in cardiopulmonary bypass (CPB), and to oxygenate blood in longer term life support, termed extracorporeal membrane oxygenation (ECMO). A membrane oxygenator consists of a thin gas-permeable membrane separating the blood and gas flows in the CPB circuit; oxygen diffuses from the gas side into the blood, and carbon dioxide diffuses from the blood into the gas for disposal.