A nice overview of STM primitives.