atomic operations from chapter 6