123456789_123456789_123456789_123456789_123456789_

Module: Concurrent::Synchronization::Volatile

Relationships & Source Files
Namespace Children
Modules:
Extension / Inclusion / Inheritance Descendants
Included In:
AbstractExchanger, Atom, AtomicMarkableReference, Cancellation, Channel::Tick, Edge::LockFreeLinkedSet::Head, Edge::LockFreeLinkedSet::Node, Edge::LockFreeLinkedSet::Tail, ErlangActor::AbstractActor, ErlangActor::AbstractSignal, ErlangActor::Ask, ErlangActor::DeMonitor, ErlangActor::DownSignal, ErlangActor::Environment, ErlangActor::Kill, ErlangActor::Link, ErlangActor::Monitor, ErlangActor::OnPool, ErlangActor::OnThread, ErlangActor::Pid, ErlangActor::Terminate, ErlangActor::UnLink, JavaExchanger, LazyRegister, LockFreeQueue, LockFreeQueue::Node, LockFreeStack, MVar, Maybe, ProcessingActor, Promises::AbstractAnyPromise, Promises::AbstractEventFuture, Promises::AbstractFlatPromise, Promises::AbstractPromise, Promises::AnyFulfilledFuturePromise, Promises::AnyResolvedEventPromise, Promises::AnyResolvedFuturePromise, Promises::BlockedPromise, Promises::BlockedTaskPromise, Promises::ChainPromise, Promises::Channel, Promises::DelayPromise, Promises::Event, Promises::EventWrapperPromise, Promises::FlatEventPromise, Promises::FlatFuturePromise, Promises::Future, Promises::FutureWrapperPromise, Promises::ImmediateEventPromise, Promises::ImmediateFuturePromise, Promises::InnerPromise, Promises::RescuePromise, Promises::ResolvableEvent, Promises::ResolvableEventPromise, Promises::ResolvableFuture, Promises::ResolvableFuturePromise, Promises::RunFuturePromise, Promises::ScheduledPromise, Promises::ThenPromise, Promises::ZipEventEventPromise, Promises::ZipEventsPromise, Promises::ZipFutureEventPromise, Promises::ZipFuturesPromise, ReadWriteLock, ReentrantReadWriteLock, RubyExchanger, RubyExchanger::Node, AbstractLockableObject, JRubyLockableObject, MonitorLockableObject, MutexLockableObject, Object, TVar, Throttle, Throttle::ProxyExecutor, WrappingExecutor
Defined in: lib/concurrent-ruby/concurrent/synchronization/volatile.rb

Overview

Volatile adds the attr_volatile class method when included.

foo = Foo.new
foo.bar
#=> 1
foo.bar = 2
#=> 2

Examples:

class Foo
  include Concurrent::Synchronization::Volatile

  attr_volatile :bar

  def initialize
    self.bar = 1
  end
end

Class Method Summary

Instance Method Summary

Class Method Details

.included(base)

[ GitHub ]

  
# File 'lib/concurrent-ruby/concurrent/synchronization/volatile.rb', line 29

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#full_memory_barrier

[ GitHub ]

  
# File 'lib/concurrent-ruby/concurrent/synchronization/volatile.rb', line 33

def full_memory_barrier
  Synchronization.full_memory_barrier
end