[sgen] Add missing memory barrier
authorVlad Brezae <brezaevlad@gmail.com>
Thu, 21 Jul 2016 21:43:40 +0000 (00:43 +0300)
committerVlad Brezae <brezaevlad@gmail.com>
Thu, 21 Jul 2016 22:14:53 +0000 (01:14 +0300)
When doing the first phase of sweeping we tag the block pointer within the block list with a CAS, after which we own the block and we are free to update the state and do sweep computations on the block. When we finish this phase we directly write the untagged block pointer back in the list, making the block available to inspect by other threads. We need a write barrier before writting the untagged pointer back because, when another thread might acquire the block, it might encounter an invalid block state.


No differences found