Exception: Concurrent::ConcurrentUpdateError
- Inherits:
-
ThreadError
- Object
- ThreadError
- Concurrent::ConcurrentUpdateError
- Defined in:
- lib/concurrent/atomic_reference/concurrent_update_error.rb
Overview
An object reference that may be updated atomically.
Testing with ruby 2.1.2
*** Sequential updates ***
user system total real
no lock 0.000000 0.000000 0.000000 ( 0.005502)
mutex 0.030000 0.000000 0.030000 ( 0.025158)
MutexAtomicReference 0.100000 0.000000 0.100000 ( 0.103096)
CAtomicReference 0.040000 0.000000 0.040000 ( 0.034012)
*** Parallel updates ***
user system total real
no lock 0.010000 0.000000 0.010000 ( 0.009387)
mutex 0.030000 0.010000 0.040000 ( 0.032545)
MutexAtomicReference 0.830000 2.280000 3.110000 ( 2.146622)
CAtomicReference 0.040000 0.000000 0.040000 ( 0.038332)
Testing with jruby 1.9.3
*** Sequential updates ***
user system total real
no lock 0.170000 0.000000 0.170000 ( 0.051000)
mutex 0.370000 0.010000 0.380000 ( 0.121000)
MutexAtomicReference 1.530000 0.020000 1.550000 ( 0.471000)
JavaAtomicReference 0.370000 0.010000 0.380000 ( 0.112000)
*** Parallel updates ***
user system total real
no lock 0.390000 0.000000 0.390000 ( 0.105000)
mutex 0.480000 0.040000 0.520000 ( 0.145000)
MutexAtomicReference 1.600000 0.180000 1.780000 ( 0.511000)
JavaAtomicReference 0.460000 0.010000 0.470000 ( 0.131000)
Constant Summary collapse
- CONC_UP_ERR_BACKTRACE =
frozen pre-allocated backtrace to speed ConcurrentUpdateError
['backtrace elided; set verbose to enable'].freeze
Instance Method Summary collapse
-
#compare_and_set ⇒ Boolean
Atomically sets the value to the given updated value if the current value == the expected value.
-
#get ⇒ Object
Gets the current value.
-
#get_and_set ⇒ Object
Atomically sets to the given value and returns the old value.
- #initialize ⇒ Object constructor
-
#set ⇒ Object
Sets to the given value.
Constructor Details
#initialize ⇒ Object
4 5 6 7 |
# File 'lib/concurrent/atomic_reference/concurrent_update_error.rb', line 4 class ConcurrentUpdateError < ThreadError # frozen pre-allocated backtrace to speed ConcurrentUpdateError CONC_UP_ERR_BACKTRACE = ['backtrace elided; set verbose to enable'].freeze end |
Instance Method Details
#compare_and_set ⇒ Boolean
Atomically sets the value to the given updated value if the current value == the expected value.
that the actual value was not equal to the expected value.
4 5 6 7 |
# File 'lib/concurrent/atomic_reference/concurrent_update_error.rb', line 4 class ConcurrentUpdateError < ThreadError # frozen pre-allocated backtrace to speed ConcurrentUpdateError CONC_UP_ERR_BACKTRACE = ['backtrace elided; set verbose to enable'].freeze end |
#get ⇒ Object
Gets the current value.
4 5 6 7 |
# File 'lib/concurrent/atomic_reference/concurrent_update_error.rb', line 4 class ConcurrentUpdateError < ThreadError # frozen pre-allocated backtrace to speed ConcurrentUpdateError CONC_UP_ERR_BACKTRACE = ['backtrace elided; set verbose to enable'].freeze end |
#get_and_set ⇒ Object
Atomically sets to the given value and returns the old value.
4 5 6 7 |
# File 'lib/concurrent/atomic_reference/concurrent_update_error.rb', line 4 class ConcurrentUpdateError < ThreadError # frozen pre-allocated backtrace to speed ConcurrentUpdateError CONC_UP_ERR_BACKTRACE = ['backtrace elided; set verbose to enable'].freeze end |
#set ⇒ Object
Sets to the given value.
4 5 6 7 |
# File 'lib/concurrent/atomic_reference/concurrent_update_error.rb', line 4 class ConcurrentUpdateError < ThreadError # frozen pre-allocated backtrace to speed ConcurrentUpdateError CONC_UP_ERR_BACKTRACE = ['backtrace elided; set verbose to enable'].freeze end |