### Home Classes Methods

### In Files

- lib/thread_safe/util/striped64.rb

### Parent

AtomicReference

### Methods

- #cas_computed

### Class/Module Index

Quicksearch

- ThreadSafe
- ThreadSafe::Array
- ThreadSafe::AtomicReferenceCacheBackend
- ThreadSafe::AtomicReferenceCacheBackend::Node
- ThreadSafe::AtomicReferenceCacheBackend::Table
- ThreadSafe::Cache
- ThreadSafe::Hash
- ThreadSafe::MriCacheBackend
- ThreadSafe::NonConcurrentCacheBackend
- ThreadSafe::SynchronizedCacheBackend
- ThreadSafe::Util
- ThreadSafe::Util::Adder
- ThreadSafe::Util::CheapLockable
- ThreadSafe::Util::PowerOfTwoTuple
- ThreadSafe::Util::Striped64
- ThreadSafe::Util::Striped64::Cell
- ThreadSafe::Util::Volatile
- ThreadSafe::Util::VolatileTuple
- ThreadSafe::Util::XorShiftRandom
- SynchronizedDelegator
- Threadsafe

No matching classes.

# ThreadSafe::Util::Striped64::Cell

Padded variant of AtomicLong supporting only raw accesses plus CAS. The `value` field is placed between pads, hoping that the JVM doesn't reorder them.

Optimisation note: It would be possible to use a release-only form of CAS here, if it were provided.

### Public Instance Methods

cas_computed() click to toggle source

    # File lib/thread_safe/util/striped64.rb, line 77
    def cas_computed
      cas(current_value = value, yield(current_value))
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.