concurrent-ruby 1.0.5 → 1.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +155 -0
- data/Gemfile +37 -0
- data/LICENSE.txt +18 -18
- data/README.md +260 -103
- data/Rakefile +329 -0
- data/ext/concurrent-ruby/ConcurrentRubyService.java +17 -0
- data/ext/concurrent-ruby/com/concurrent_ruby/ext/AtomicReferenceLibrary.java +175 -0
- data/ext/concurrent-ruby/com/concurrent_ruby/ext/JRubyMapBackendLibrary.java +248 -0
- data/ext/concurrent-ruby/com/concurrent_ruby/ext/JavaAtomicBooleanLibrary.java +93 -0
- data/ext/concurrent-ruby/com/concurrent_ruby/ext/JavaAtomicFixnumLibrary.java +113 -0
- data/ext/concurrent-ruby/com/concurrent_ruby/ext/JavaSemaphoreLibrary.java +189 -0
- data/ext/concurrent-ruby/com/concurrent_ruby/ext/SynchronizationLibrary.java +307 -0
- data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/ConcurrentHashMap.java +31 -0
- data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/ConcurrentHashMapV8.java +3863 -0
- data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/LongAdder.java +203 -0
- data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/Striped64.java +342 -0
- data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/ConcurrentHashMapV8.java +3800 -0
- data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/LongAdder.java +204 -0
- data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/Striped64.java +291 -0
- data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166y/ThreadLocalRandom.java +199 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/agent.rb +7 -7
- data/lib/concurrent-ruby/concurrent/array.rb +66 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/async.rb +28 -24
- data/lib/{concurrent → concurrent-ruby/concurrent}/atom.rb +10 -10
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/atomic_boolean.rb +26 -22
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/atomic_fixnum.rb +27 -23
- data/lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb +164 -0
- data/lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb +205 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/count_down_latch.rb +7 -7
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/cyclic_barrier.rb +1 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/event.rb +3 -3
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/java_count_down_latch.rb +9 -6
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/mutex_atomic_boolean.rb +2 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/mutex_count_down_latch.rb +1 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/mutex_semaphore.rb +18 -2
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/read_write_lock.rb +2 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/reentrant_read_write_lock.rb +7 -7
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/ruby_thread_local_var.rb +60 -40
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/semaphore.rb +34 -13
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/thread_local_var.rb +8 -8
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic_reference/mutex_atomic.rb +3 -8
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic_reference/numeric_cas_wrapper.rb +1 -1
- data/lib/concurrent-ruby/concurrent/atomics.rb +10 -0
- data/lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb +158 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/collection/map/atomic_reference_map_backend.rb +3 -3
- data/lib/{concurrent → concurrent-ruby/concurrent}/collection/map/mri_map_backend.rb +1 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/collection/map/non_concurrent_map_backend.rb +1 -2
- data/lib/concurrent-ruby/concurrent/collection/map/truffleruby_map_backend.rb +14 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/collection/non_concurrent_priority_queue.rb +30 -30
- data/lib/{concurrent → concurrent-ruby/concurrent}/collection/ruby_non_concurrent_priority_queue.rb +11 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/concern/dereferenceable.rb +3 -3
- data/lib/{concurrent → concurrent-ruby/concurrent}/concern/logging.rb +6 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/concern/observable.rb +7 -7
- data/lib/concurrent-ruby/concurrent/concurrent_ruby.jar +0 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/configuration.rb +15 -15
- data/lib/{concurrent → concurrent-ruby/concurrent}/constants.rb +1 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/dataflow.rb +2 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/delay.rb +9 -7
- data/lib/{concurrent → concurrent-ruby/concurrent}/exchanger.rb +21 -25
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/abstract_executor_service.rb +35 -38
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/cached_thread_pool.rb +5 -5
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/executor_service.rb +17 -17
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/fixed_thread_pool.rb +47 -33
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/java_executor_service.rb +20 -17
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/java_single_thread_executor.rb +4 -3
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/java_thread_pool_executor.rb +29 -9
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/ruby_executor_service.rb +10 -6
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/ruby_single_thread_executor.rb +0 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/ruby_thread_pool_executor.rb +46 -42
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/safe_task_executor.rb +5 -5
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/simple_executor_service.rb +1 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/single_thread_executor.rb +3 -2
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/thread_pool_executor.rb +7 -6
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/timer_set.rb +14 -17
- data/lib/{concurrent → concurrent-ruby/concurrent}/future.rb +4 -1
- data/lib/concurrent-ruby/concurrent/hash.rb +59 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/immutable_struct.rb +9 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/ivar.rb +5 -6
- data/lib/concurrent-ruby/concurrent/map.rb +346 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/maybe.rb +1 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/mutable_struct.rb +27 -16
- data/lib/{concurrent → concurrent-ruby/concurrent}/mvar.rb +2 -2
- data/lib/{concurrent → concurrent-ruby/concurrent}/promise.rb +54 -21
- data/lib/concurrent-ruby/concurrent/promises.rb +2167 -0
- data/lib/concurrent-ruby/concurrent/re_include.rb +58 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/scheduled_task.rb +29 -16
- data/lib/concurrent-ruby/concurrent/set.rb +74 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/settable_struct.rb +12 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/abstract_lockable_object.rb +5 -5
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/abstract_struct.rb +18 -4
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/condition.rb +2 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/jruby_object.rb +1 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/lock.rb +2 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/lockable_object.rb +8 -10
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/mri_object.rb +1 -0
- data/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb +88 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/object.rb +53 -23
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/rbx_lockable_object.rb +6 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/rbx_object.rb +1 -0
- data/lib/concurrent-ruby/concurrent/synchronization/truffleruby_object.rb +47 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/volatile.rb +11 -9
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization.rb +4 -5
- data/lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb +88 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/util/striped64.rb +9 -4
- data/lib/{concurrent → concurrent-ruby/concurrent}/timer_task.rb +15 -35
- data/lib/{concurrent → concurrent-ruby/concurrent}/tuple.rb +1 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/tvar.rb +21 -58
- data/lib/{concurrent → concurrent-ruby/concurrent}/utility/engine.rb +4 -4
- data/lib/concurrent-ruby/concurrent/utility/monotonic_time.rb +90 -0
- data/lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb +79 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/utility/processor_counter.rb +5 -35
- data/lib/concurrent-ruby/concurrent/version.rb +3 -0
- data/lib/concurrent-ruby/concurrent-ruby.rb +5 -0
- data/lib/{concurrent.rb → concurrent-ruby/concurrent.rb} +24 -20
- metadata +149 -134
- data/lib/concurrent/array.rb +0 -39
- data/lib/concurrent/atomic/atomic_reference.rb +0 -51
- data/lib/concurrent/atomic_reference/concurrent_update_error.rb +0 -8
- data/lib/concurrent/atomic_reference/direct_update.rb +0 -81
- data/lib/concurrent/atomic_reference/jruby+truffle.rb +0 -2
- data/lib/concurrent/atomic_reference/jruby.rb +0 -16
- data/lib/concurrent/atomic_reference/rbx.rb +0 -22
- data/lib/concurrent/atomic_reference/ruby.rb +0 -32
- data/lib/concurrent/atomics.rb +0 -53
- data/lib/concurrent/edge.rb +0 -26
- data/lib/concurrent/hash.rb +0 -36
- data/lib/concurrent/lazy_register.rb +0 -81
- data/lib/concurrent/map.rb +0 -240
- data/lib/concurrent/synchronization/mri_lockable_object.rb +0 -71
- data/lib/concurrent/synchronization/truffle_lockable_object.rb +0 -9
- data/lib/concurrent/synchronization/truffle_object.rb +0 -31
- data/lib/concurrent/thread_safe/util/array_hash_rbx.rb +0 -30
- data/lib/concurrent/utility/at_exit.rb +0 -97
- data/lib/concurrent/utility/monotonic_time.rb +0 -58
- data/lib/concurrent/utility/native_extension_loader.rb +0 -73
- data/lib/concurrent/version.rb +0 -4
- /data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/abstract_thread_local_var.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/java_thread_local_var.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/mutex_atomic_fixnum.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/collection/copy_on_notify_observer_set.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/collection/copy_on_write_observer_set.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/collection/java_non_concurrent_priority_queue.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/collection/map/synchronized_map_backend.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/concern/deprecation.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/concern/obligation.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/errors.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/executor/immediate_executor.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/executor/indirect_immediate_executor.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/executor/serial_executor_service.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/executor/serialized_execution.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/executor/serialized_execution_delegator.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/executors.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/options.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/abstract_object.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/jruby_lockable_object.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/synchronized_delegator.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/util/adder.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/util/cheap_lockable.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/util/power_of_two_tuple.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/util/volatile.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/util/xor_shift_random.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/util.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/utility/native_integer.rb +0 -0
@@ -0,0 +1,79 @@
|
|
1
|
+
require 'concurrent/utility/engine'
|
2
|
+
|
3
|
+
module Concurrent
|
4
|
+
|
5
|
+
module Utility
|
6
|
+
|
7
|
+
# @!visibility private
|
8
|
+
module NativeExtensionLoader
|
9
|
+
|
10
|
+
def allow_c_extensions?
|
11
|
+
Concurrent.on_cruby?
|
12
|
+
end
|
13
|
+
|
14
|
+
def c_extensions_loaded?
|
15
|
+
defined?(@c_extensions_loaded) && @c_extensions_loaded
|
16
|
+
end
|
17
|
+
|
18
|
+
def java_extensions_loaded?
|
19
|
+
defined?(@java_extensions_loaded) && @java_extensions_loaded
|
20
|
+
end
|
21
|
+
|
22
|
+
def load_native_extensions
|
23
|
+
unless defined? Synchronization::AbstractObject
|
24
|
+
raise 'native_extension_loader loaded before Synchronization::AbstractObject'
|
25
|
+
end
|
26
|
+
|
27
|
+
if Concurrent.on_cruby? && !c_extensions_loaded?
|
28
|
+
['concurrent/concurrent_ruby_ext',
|
29
|
+
"concurrent/#{RUBY_VERSION[0..2]}/concurrent_ruby_ext"
|
30
|
+
].each { |p| try_load_c_extension p }
|
31
|
+
end
|
32
|
+
|
33
|
+
if Concurrent.on_jruby? && !java_extensions_loaded?
|
34
|
+
begin
|
35
|
+
require 'concurrent/concurrent_ruby.jar'
|
36
|
+
set_java_extensions_loaded
|
37
|
+
rescue LoadError => e
|
38
|
+
raise e, "Java extensions are required for JRuby.\n" + e.message, e.backtrace
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def load_error_path(error)
|
46
|
+
if error.respond_to? :path
|
47
|
+
error.path
|
48
|
+
else
|
49
|
+
error.message.split(' -- ').last
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def set_c_extensions_loaded
|
54
|
+
@c_extensions_loaded = true
|
55
|
+
end
|
56
|
+
|
57
|
+
def set_java_extensions_loaded
|
58
|
+
@java_extensions_loaded = true
|
59
|
+
end
|
60
|
+
|
61
|
+
def try_load_c_extension(path)
|
62
|
+
require path
|
63
|
+
set_c_extensions_loaded
|
64
|
+
rescue LoadError => e
|
65
|
+
if load_error_path(e) == path
|
66
|
+
# move on with pure-Ruby implementations
|
67
|
+
# TODO (pitr-ch 12-Jul-2018): warning on verbose?
|
68
|
+
else
|
69
|
+
raise e
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# @!visibility private
|
77
|
+
extend Utility::NativeExtensionLoader
|
78
|
+
end
|
79
|
+
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'etc'
|
1
2
|
require 'rbconfig'
|
2
3
|
require 'concurrent/delay'
|
3
4
|
|
@@ -22,6 +23,8 @@ module Concurrent
|
|
22
23
|
# occasionally poll this property." Subsequently the result will NOT be
|
23
24
|
# memoized under JRuby.
|
24
25
|
#
|
26
|
+
# Ruby's Etc.nprocessors will be used if available (MRI 2.2+).
|
27
|
+
#
|
25
28
|
# On Windows the Win32 API will be queried for the
|
26
29
|
# `NumberOfLogicalProcessors from Win32_Processor`. This will return the
|
27
30
|
# total number "logical processors for the current instance of the
|
@@ -76,47 +79,14 @@ module Concurrent
|
|
76
79
|
def compute_processor_count
|
77
80
|
if Concurrent.on_jruby?
|
78
81
|
java.lang.Runtime.getRuntime.availableProcessors
|
79
|
-
elsif Concurrent.on_truffle?
|
80
|
-
Truffle::Primitive.logical_processors
|
81
82
|
else
|
82
|
-
|
83
|
-
if os_name =~ /mingw|mswin/
|
84
|
-
require 'win32ole'
|
85
|
-
result = WIN32OLE.connect("winmgmts://").ExecQuery(
|
86
|
-
"select NumberOfLogicalProcessors from Win32_Processor")
|
87
|
-
result.to_enum.collect(&:NumberOfLogicalProcessors).reduce(:+)
|
88
|
-
elsif File.readable?("/proc/cpuinfo") && (cpuinfo_count = IO.read("/proc/cpuinfo").scan(/^processor/).size) > 0
|
89
|
-
cpuinfo_count
|
90
|
-
elsif File.executable?("/usr/bin/nproc")
|
91
|
-
IO.popen("/usr/bin/nproc --all", &:read).to_i
|
92
|
-
elsif File.executable?("/usr/bin/hwprefs")
|
93
|
-
IO.popen("/usr/bin/hwprefs thread_count", &:read).to_i
|
94
|
-
elsif File.executable?("/usr/sbin/psrinfo")
|
95
|
-
IO.popen("/usr/sbin/psrinfo", &:read).scan(/^.*on-*line/).size
|
96
|
-
elsif File.executable?("/usr/sbin/ioscan")
|
97
|
-
IO.popen("/usr/sbin/ioscan -kC processor", &:read).scan(/^.*processor/).size
|
98
|
-
elsif File.executable?("/usr/sbin/pmcycles")
|
99
|
-
IO.popen("/usr/sbin/pmcycles -m", &:read).count("\n")
|
100
|
-
elsif File.executable?("/usr/sbin/lsdev")
|
101
|
-
IO.popen("/usr/sbin/lsdev -Cc processor -S 1", &:read).count("\n")
|
102
|
-
elsif File.executable?("/usr/sbin/sysconf") and os_name =~ /irix/i
|
103
|
-
IO.popen("/usr/sbin/sysconf NPROC_ONLN", &:read).to_i
|
104
|
-
elsif File.executable?("/usr/sbin/sysctl")
|
105
|
-
IO.popen("/usr/sbin/sysctl -n hw.ncpu", &:read).to_i
|
106
|
-
elsif File.executable?("/sbin/sysctl")
|
107
|
-
IO.popen("/sbin/sysctl -n hw.ncpu", &:read).to_i
|
108
|
-
else
|
109
|
-
# TODO (pitr-ch 05-Nov-2016): warn about failures
|
110
|
-
1
|
111
|
-
end
|
83
|
+
Etc.nprocessors
|
112
84
|
end
|
113
|
-
rescue
|
114
|
-
return 1
|
115
85
|
end
|
116
86
|
|
117
87
|
def compute_physical_processor_count
|
118
88
|
ppc = case RbConfig::CONFIG["target_os"]
|
119
|
-
when /
|
89
|
+
when /darwin\d\d/
|
120
90
|
IO.popen("/usr/sbin/sysctl -n hw.physicalcpu", &:read).to_i
|
121
91
|
when /linux/
|
122
92
|
cores = {} # unique physical ID / core ID combinations
|
@@ -7,11 +7,13 @@ require 'concurrent/atomics'
|
|
7
7
|
require 'concurrent/executors'
|
8
8
|
require 'concurrent/synchronization'
|
9
9
|
|
10
|
+
require 'concurrent/atomic/atomic_markable_reference'
|
10
11
|
require 'concurrent/atomic/atomic_reference'
|
11
12
|
require 'concurrent/agent'
|
12
13
|
require 'concurrent/atom'
|
13
14
|
require 'concurrent/array'
|
14
15
|
require 'concurrent/hash'
|
16
|
+
require 'concurrent/set'
|
15
17
|
require 'concurrent/map'
|
16
18
|
require 'concurrent/tuple'
|
17
19
|
require 'concurrent/async'
|
@@ -29,20 +31,21 @@ require 'concurrent/scheduled_task'
|
|
29
31
|
require 'concurrent/settable_struct'
|
30
32
|
require 'concurrent/timer_task'
|
31
33
|
require 'concurrent/tvar'
|
34
|
+
require 'concurrent/promises'
|
32
35
|
|
33
36
|
require 'concurrent/thread_safe/synchronized_delegator'
|
34
37
|
require 'concurrent/thread_safe/util'
|
35
38
|
|
36
39
|
require 'concurrent/options'
|
37
40
|
|
38
|
-
# @!macro
|
41
|
+
# @!macro internal_implementation_note
|
39
42
|
#
|
40
43
|
# @note **Private Implementation:** This abstraction is a private, internal
|
41
44
|
# implementation detail. It should never be used directly.
|
42
45
|
|
43
|
-
# @!macro
|
46
|
+
# @!macro monotonic_clock_warning
|
44
47
|
#
|
45
|
-
# @note Time calculations
|
48
|
+
# @note Time calculations on all platforms and languages are sensitive to
|
46
49
|
# changes to the system clock. To alleviate the potential problems
|
47
50
|
# associated with changing the system clock while an application is running,
|
48
51
|
# most modern operating systems provide a monotonic clock that operates
|
@@ -58,7 +61,7 @@ require 'concurrent/options'
|
|
58
61
|
#
|
59
62
|
# @see http://linux.die.net/man/3/clock_gettime Linux clock_gettime(3)
|
60
63
|
|
61
|
-
# @!macro
|
64
|
+
# @!macro copy_options
|
62
65
|
#
|
63
66
|
# ## Copy Options
|
64
67
|
#
|
@@ -94,7 +97,7 @@ require 'concurrent/options'
|
|
94
97
|
# as close to the behavior of a "pure" functional language (like Erlang, Clojure,
|
95
98
|
# or Haskell) as we are likely to get in Ruby.
|
96
99
|
|
97
|
-
# @!macro
|
100
|
+
# @!macro deref_options
|
98
101
|
#
|
99
102
|
# @option opts [Boolean] :dup_on_deref (false) Call `#dup` before
|
100
103
|
# returning the data from {#value}
|
@@ -104,27 +107,28 @@ require 'concurrent/options'
|
|
104
107
|
# method, call the given proc passing the internal value as the sole
|
105
108
|
# argument then return the new value returned from the proc.
|
106
109
|
|
107
|
-
# @!macro
|
110
|
+
# @!macro executor_and_deref_options
|
108
111
|
#
|
109
112
|
# @param [Hash] opts the options used to define the behavior at update and deref
|
110
113
|
# and to specify the executor on which to perform actions
|
111
114
|
# @option opts [Executor] :executor when set use the given `Executor` instance.
|
112
|
-
# Three special values are also supported: `:
|
113
|
-
# `:
|
114
|
-
# `ImmediateExecutor` object.
|
115
|
+
# Three special values are also supported: `:io` returns the global pool for
|
116
|
+
# long, blocking (IO) tasks, `:fast` returns the global pool for short, fast
|
117
|
+
# operations, and `:immediate` returns the global `ImmediateExecutor` object.
|
115
118
|
# @!macro deref_options
|
116
119
|
|
117
|
-
#
|
118
|
-
#
|
120
|
+
# @!macro warn.edge
|
121
|
+
# @api Edge
|
122
|
+
# @note **Edge Features** are under active development and may change frequently.
|
119
123
|
#
|
120
|
-
#
|
121
|
-
#
|
122
|
-
#
|
123
|
-
#
|
124
|
-
#
|
125
|
-
#
|
126
|
-
# * Exclude features that don't make sense in Ruby
|
127
|
-
# * Be small, lean, and loosely coupled
|
128
|
-
module Concurrent
|
124
|
+
# - Deprecations are not added before incompatible changes.
|
125
|
+
# - Edge version: _major_ is always 0, _minor_ bump means incompatible change,
|
126
|
+
# _patch_ bump means compatible change.
|
127
|
+
# - Edge features may also lack tests and documentation.
|
128
|
+
# - Features developed in `concurrent-ruby-edge` are expected to move
|
129
|
+
# to `concurrent-ruby` when finalised.
|
129
130
|
|
131
|
+
|
132
|
+
# {include:file:README.md}
|
133
|
+
module Concurrent
|
130
134
|
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: concurrent-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jerry D'Antonio
|
8
8
|
- Petr Chalupa
|
9
9
|
- The Ruby Concurrency Team
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2022-03-22 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: |
|
16
16
|
Modern concurrency tools including agents, futures, promises, thread pools, actors, supervisors, and more.
|
@@ -24,155 +24,170 @@ extra_rdoc_files:
|
|
24
24
|
- CHANGELOG.md
|
25
25
|
files:
|
26
26
|
- CHANGELOG.md
|
27
|
+
- Gemfile
|
27
28
|
- LICENSE.txt
|
28
29
|
- README.md
|
29
|
-
-
|
30
|
-
-
|
31
|
-
-
|
32
|
-
-
|
33
|
-
-
|
34
|
-
-
|
35
|
-
-
|
36
|
-
-
|
37
|
-
-
|
38
|
-
-
|
39
|
-
-
|
40
|
-
-
|
41
|
-
-
|
42
|
-
-
|
43
|
-
-
|
44
|
-
-
|
45
|
-
- lib/concurrent/
|
46
|
-
- lib/concurrent/
|
47
|
-
- lib/concurrent/
|
48
|
-
- lib/concurrent/
|
49
|
-
- lib/concurrent/
|
50
|
-
- lib/concurrent/
|
51
|
-
- lib/concurrent/atomic/
|
52
|
-
- lib/concurrent/
|
53
|
-
- lib/concurrent/
|
54
|
-
- lib/concurrent/
|
55
|
-
- lib/concurrent/atomic_reference
|
56
|
-
- lib/concurrent/
|
57
|
-
- lib/concurrent/
|
58
|
-
- lib/concurrent/
|
59
|
-
- lib/concurrent/
|
60
|
-
- lib/concurrent/
|
61
|
-
- lib/concurrent/
|
62
|
-
- lib/concurrent/
|
63
|
-
- lib/concurrent/
|
64
|
-
- lib/concurrent/
|
65
|
-
- lib/concurrent/
|
66
|
-
- lib/concurrent/
|
67
|
-
- lib/concurrent/
|
68
|
-
- lib/concurrent/
|
69
|
-
- lib/concurrent/
|
70
|
-
- lib/concurrent/
|
71
|
-
- lib/concurrent/
|
72
|
-
- lib/concurrent/
|
73
|
-
- lib/concurrent/
|
74
|
-
- lib/concurrent/
|
75
|
-
- lib/concurrent/
|
76
|
-
- lib/concurrent/
|
77
|
-
- lib/concurrent/
|
78
|
-
- lib/concurrent/
|
79
|
-
- lib/concurrent/
|
80
|
-
- lib/concurrent/
|
81
|
-
- lib/concurrent/
|
82
|
-
- lib/concurrent/
|
83
|
-
- lib/concurrent/
|
84
|
-
- lib/concurrent/
|
85
|
-
- lib/concurrent/
|
86
|
-
- lib/concurrent/
|
87
|
-
- lib/concurrent/
|
88
|
-
- lib/concurrent/
|
89
|
-
- lib/concurrent/
|
90
|
-
- lib/concurrent/
|
91
|
-
- lib/concurrent/
|
92
|
-
- lib/concurrent/
|
93
|
-
- lib/concurrent/
|
94
|
-
- lib/concurrent/
|
95
|
-
- lib/concurrent/
|
96
|
-
- lib/concurrent/executor/
|
97
|
-
- lib/concurrent/executor/
|
98
|
-
- lib/concurrent/executor/
|
99
|
-
- lib/concurrent/executor/
|
100
|
-
- lib/concurrent/executor/
|
101
|
-
- lib/concurrent/executor/
|
102
|
-
- lib/concurrent/
|
103
|
-
- lib/concurrent/
|
104
|
-
- lib/concurrent/
|
105
|
-
- lib/concurrent/
|
106
|
-
- lib/concurrent/
|
107
|
-
- lib/concurrent/
|
108
|
-
- lib/concurrent/
|
109
|
-
- lib/concurrent/
|
110
|
-
- lib/concurrent/
|
111
|
-
- lib/concurrent/
|
112
|
-
- lib/concurrent/
|
113
|
-
- lib/concurrent/
|
114
|
-
- lib/concurrent/
|
115
|
-
- lib/concurrent/
|
116
|
-
- lib/concurrent/
|
117
|
-
- lib/concurrent/
|
118
|
-
- lib/concurrent/
|
119
|
-
- lib/concurrent/
|
120
|
-
- lib/concurrent/
|
121
|
-
- lib/concurrent/
|
122
|
-
- lib/concurrent/
|
123
|
-
- lib/concurrent/
|
124
|
-
- lib/concurrent/
|
125
|
-
- lib/concurrent/
|
126
|
-
- lib/concurrent/
|
127
|
-
- lib/concurrent/
|
128
|
-
- lib/concurrent/
|
129
|
-
- lib/concurrent/
|
130
|
-
- lib/concurrent/
|
131
|
-
- lib/concurrent/
|
132
|
-
- lib/concurrent/synchronization
|
133
|
-
- lib/concurrent/
|
134
|
-
- lib/concurrent/
|
135
|
-
- lib/concurrent/
|
136
|
-
- lib/concurrent/
|
137
|
-
- lib/concurrent/
|
138
|
-
- lib/concurrent/
|
139
|
-
- lib/concurrent/
|
140
|
-
- lib/concurrent/
|
141
|
-
- lib/concurrent/
|
142
|
-
- lib/concurrent/
|
143
|
-
- lib/concurrent/
|
144
|
-
- lib/concurrent/
|
145
|
-
- lib/concurrent/
|
146
|
-
- lib/concurrent/
|
147
|
-
- lib/concurrent/
|
148
|
-
- lib/concurrent/
|
149
|
-
- lib/concurrent/
|
150
|
-
- lib/concurrent/
|
151
|
-
- lib/concurrent/
|
30
|
+
- Rakefile
|
31
|
+
- ext/concurrent-ruby/ConcurrentRubyService.java
|
32
|
+
- ext/concurrent-ruby/com/concurrent_ruby/ext/AtomicReferenceLibrary.java
|
33
|
+
- ext/concurrent-ruby/com/concurrent_ruby/ext/JRubyMapBackendLibrary.java
|
34
|
+
- ext/concurrent-ruby/com/concurrent_ruby/ext/JavaAtomicBooleanLibrary.java
|
35
|
+
- ext/concurrent-ruby/com/concurrent_ruby/ext/JavaAtomicFixnumLibrary.java
|
36
|
+
- ext/concurrent-ruby/com/concurrent_ruby/ext/JavaSemaphoreLibrary.java
|
37
|
+
- ext/concurrent-ruby/com/concurrent_ruby/ext/SynchronizationLibrary.java
|
38
|
+
- ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/ConcurrentHashMap.java
|
39
|
+
- ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/ConcurrentHashMapV8.java
|
40
|
+
- ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/LongAdder.java
|
41
|
+
- ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/Striped64.java
|
42
|
+
- ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/ConcurrentHashMapV8.java
|
43
|
+
- ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/LongAdder.java
|
44
|
+
- ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/Striped64.java
|
45
|
+
- ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166y/ThreadLocalRandom.java
|
46
|
+
- lib/concurrent-ruby/concurrent-ruby.rb
|
47
|
+
- lib/concurrent-ruby/concurrent.rb
|
48
|
+
- lib/concurrent-ruby/concurrent/agent.rb
|
49
|
+
- lib/concurrent-ruby/concurrent/array.rb
|
50
|
+
- lib/concurrent-ruby/concurrent/async.rb
|
51
|
+
- lib/concurrent-ruby/concurrent/atom.rb
|
52
|
+
- lib/concurrent-ruby/concurrent/atomic/abstract_thread_local_var.rb
|
53
|
+
- lib/concurrent-ruby/concurrent/atomic/atomic_boolean.rb
|
54
|
+
- lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb
|
55
|
+
- lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb
|
56
|
+
- lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb
|
57
|
+
- lib/concurrent-ruby/concurrent/atomic/count_down_latch.rb
|
58
|
+
- lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb
|
59
|
+
- lib/concurrent-ruby/concurrent/atomic/event.rb
|
60
|
+
- lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
|
61
|
+
- lib/concurrent-ruby/concurrent/atomic/java_thread_local_var.rb
|
62
|
+
- lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb
|
63
|
+
- lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb
|
64
|
+
- lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb
|
65
|
+
- lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb
|
66
|
+
- lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb
|
67
|
+
- lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb
|
68
|
+
- lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb
|
69
|
+
- lib/concurrent-ruby/concurrent/atomic/semaphore.rb
|
70
|
+
- lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb
|
71
|
+
- lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb
|
72
|
+
- lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb
|
73
|
+
- lib/concurrent-ruby/concurrent/atomics.rb
|
74
|
+
- lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb
|
75
|
+
- lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb
|
76
|
+
- lib/concurrent-ruby/concurrent/collection/java_non_concurrent_priority_queue.rb
|
77
|
+
- lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb
|
78
|
+
- lib/concurrent-ruby/concurrent/collection/map/atomic_reference_map_backend.rb
|
79
|
+
- lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb
|
80
|
+
- lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb
|
81
|
+
- lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb
|
82
|
+
- lib/concurrent-ruby/concurrent/collection/map/truffleruby_map_backend.rb
|
83
|
+
- lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb
|
84
|
+
- lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb
|
85
|
+
- lib/concurrent-ruby/concurrent/concern/deprecation.rb
|
86
|
+
- lib/concurrent-ruby/concurrent/concern/dereferenceable.rb
|
87
|
+
- lib/concurrent-ruby/concurrent/concern/logging.rb
|
88
|
+
- lib/concurrent-ruby/concurrent/concern/obligation.rb
|
89
|
+
- lib/concurrent-ruby/concurrent/concern/observable.rb
|
90
|
+
- lib/concurrent-ruby/concurrent/concurrent_ruby.jar
|
91
|
+
- lib/concurrent-ruby/concurrent/configuration.rb
|
92
|
+
- lib/concurrent-ruby/concurrent/constants.rb
|
93
|
+
- lib/concurrent-ruby/concurrent/dataflow.rb
|
94
|
+
- lib/concurrent-ruby/concurrent/delay.rb
|
95
|
+
- lib/concurrent-ruby/concurrent/errors.rb
|
96
|
+
- lib/concurrent-ruby/concurrent/exchanger.rb
|
97
|
+
- lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb
|
98
|
+
- lib/concurrent-ruby/concurrent/executor/cached_thread_pool.rb
|
99
|
+
- lib/concurrent-ruby/concurrent/executor/executor_service.rb
|
100
|
+
- lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb
|
101
|
+
- lib/concurrent-ruby/concurrent/executor/immediate_executor.rb
|
102
|
+
- lib/concurrent-ruby/concurrent/executor/indirect_immediate_executor.rb
|
103
|
+
- lib/concurrent-ruby/concurrent/executor/java_executor_service.rb
|
104
|
+
- lib/concurrent-ruby/concurrent/executor/java_single_thread_executor.rb
|
105
|
+
- lib/concurrent-ruby/concurrent/executor/java_thread_pool_executor.rb
|
106
|
+
- lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb
|
107
|
+
- lib/concurrent-ruby/concurrent/executor/ruby_single_thread_executor.rb
|
108
|
+
- lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb
|
109
|
+
- lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb
|
110
|
+
- lib/concurrent-ruby/concurrent/executor/serial_executor_service.rb
|
111
|
+
- lib/concurrent-ruby/concurrent/executor/serialized_execution.rb
|
112
|
+
- lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
|
113
|
+
- lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb
|
114
|
+
- lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb
|
115
|
+
- lib/concurrent-ruby/concurrent/executor/thread_pool_executor.rb
|
116
|
+
- lib/concurrent-ruby/concurrent/executor/timer_set.rb
|
117
|
+
- lib/concurrent-ruby/concurrent/executors.rb
|
118
|
+
- lib/concurrent-ruby/concurrent/future.rb
|
119
|
+
- lib/concurrent-ruby/concurrent/hash.rb
|
120
|
+
- lib/concurrent-ruby/concurrent/immutable_struct.rb
|
121
|
+
- lib/concurrent-ruby/concurrent/ivar.rb
|
122
|
+
- lib/concurrent-ruby/concurrent/map.rb
|
123
|
+
- lib/concurrent-ruby/concurrent/maybe.rb
|
124
|
+
- lib/concurrent-ruby/concurrent/mutable_struct.rb
|
125
|
+
- lib/concurrent-ruby/concurrent/mvar.rb
|
126
|
+
- lib/concurrent-ruby/concurrent/options.rb
|
127
|
+
- lib/concurrent-ruby/concurrent/promise.rb
|
128
|
+
- lib/concurrent-ruby/concurrent/promises.rb
|
129
|
+
- lib/concurrent-ruby/concurrent/re_include.rb
|
130
|
+
- lib/concurrent-ruby/concurrent/scheduled_task.rb
|
131
|
+
- lib/concurrent-ruby/concurrent/set.rb
|
132
|
+
- lib/concurrent-ruby/concurrent/settable_struct.rb
|
133
|
+
- lib/concurrent-ruby/concurrent/synchronization.rb
|
134
|
+
- lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb
|
135
|
+
- lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb
|
136
|
+
- lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb
|
137
|
+
- lib/concurrent-ruby/concurrent/synchronization/condition.rb
|
138
|
+
- lib/concurrent-ruby/concurrent/synchronization/jruby_lockable_object.rb
|
139
|
+
- lib/concurrent-ruby/concurrent/synchronization/jruby_object.rb
|
140
|
+
- lib/concurrent-ruby/concurrent/synchronization/lock.rb
|
141
|
+
- lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb
|
142
|
+
- lib/concurrent-ruby/concurrent/synchronization/mri_object.rb
|
143
|
+
- lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb
|
144
|
+
- lib/concurrent-ruby/concurrent/synchronization/object.rb
|
145
|
+
- lib/concurrent-ruby/concurrent/synchronization/rbx_lockable_object.rb
|
146
|
+
- lib/concurrent-ruby/concurrent/synchronization/rbx_object.rb
|
147
|
+
- lib/concurrent-ruby/concurrent/synchronization/truffleruby_object.rb
|
148
|
+
- lib/concurrent-ruby/concurrent/synchronization/volatile.rb
|
149
|
+
- lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb
|
150
|
+
- lib/concurrent-ruby/concurrent/thread_safe/util.rb
|
151
|
+
- lib/concurrent-ruby/concurrent/thread_safe/util/adder.rb
|
152
|
+
- lib/concurrent-ruby/concurrent/thread_safe/util/cheap_lockable.rb
|
153
|
+
- lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb
|
154
|
+
- lib/concurrent-ruby/concurrent/thread_safe/util/power_of_two_tuple.rb
|
155
|
+
- lib/concurrent-ruby/concurrent/thread_safe/util/striped64.rb
|
156
|
+
- lib/concurrent-ruby/concurrent/thread_safe/util/volatile.rb
|
157
|
+
- lib/concurrent-ruby/concurrent/thread_safe/util/xor_shift_random.rb
|
158
|
+
- lib/concurrent-ruby/concurrent/timer_task.rb
|
159
|
+
- lib/concurrent-ruby/concurrent/tuple.rb
|
160
|
+
- lib/concurrent-ruby/concurrent/tvar.rb
|
161
|
+
- lib/concurrent-ruby/concurrent/utility/engine.rb
|
162
|
+
- lib/concurrent-ruby/concurrent/utility/monotonic_time.rb
|
163
|
+
- lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb
|
164
|
+
- lib/concurrent-ruby/concurrent/utility/native_integer.rb
|
165
|
+
- lib/concurrent-ruby/concurrent/utility/processor_counter.rb
|
166
|
+
- lib/concurrent-ruby/concurrent/version.rb
|
152
167
|
homepage: http://www.concurrent-ruby.com
|
153
168
|
licenses:
|
154
169
|
- MIT
|
155
|
-
metadata:
|
156
|
-
|
170
|
+
metadata:
|
171
|
+
source_code_uri: https://github.com/ruby-concurrency/concurrent-ruby
|
172
|
+
changelog_uri: https://github.com/ruby-concurrency/concurrent-ruby/blob/master/CHANGELOG.md
|
173
|
+
post_install_message:
|
157
174
|
rdoc_options: []
|
158
175
|
require_paths:
|
159
|
-
- lib
|
176
|
+
- lib/concurrent-ruby
|
160
177
|
required_ruby_version: !ruby/object:Gem::Requirement
|
161
178
|
requirements:
|
162
179
|
- - ">="
|
163
180
|
- !ruby/object:Gem::Version
|
164
|
-
version:
|
181
|
+
version: '2.2'
|
165
182
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
183
|
requirements:
|
167
184
|
- - ">="
|
168
185
|
- !ruby/object:Gem::Version
|
169
186
|
version: '0'
|
170
187
|
requirements: []
|
171
|
-
|
172
|
-
|
173
|
-
signing_key:
|
188
|
+
rubygems_version: 3.3.4
|
189
|
+
signing_key:
|
174
190
|
specification_version: 4
|
175
191
|
summary: Modern concurrency tools for Ruby. Inspired by Erlang, Clojure, Scala, Haskell,
|
176
192
|
F#, C#, Java, and classic concurrency patterns.
|
177
193
|
test_files: []
|
178
|
-
has_rdoc:
|
data/lib/concurrent/array.rb
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
require 'concurrent/utility/engine'
|
2
|
-
require 'concurrent/thread_safe/util'
|
3
|
-
|
4
|
-
module Concurrent
|
5
|
-
if Concurrent.on_cruby?
|
6
|
-
|
7
|
-
# Because MRI never runs code in parallel, the existing
|
8
|
-
# non-thread-safe structures should usually work fine.
|
9
|
-
|
10
|
-
# @!macro [attach] concurrent_array
|
11
|
-
#
|
12
|
-
# A thread-safe subclass of Array. This version locks against the object
|
13
|
-
# itself for every method call, ensuring only one thread can be reading
|
14
|
-
# or writing at a time. This includes iteration methods like `#each`.
|
15
|
-
#
|
16
|
-
# @see http://ruby-doc.org/core-2.2.0/Array.html Ruby standard library `Array`
|
17
|
-
class Array < ::Array;
|
18
|
-
end
|
19
|
-
|
20
|
-
elsif Concurrent.on_jruby?
|
21
|
-
require 'jruby/synchronized'
|
22
|
-
|
23
|
-
# @!macro concurrent_array
|
24
|
-
class Array < ::Array
|
25
|
-
include JRuby::Synchronized
|
26
|
-
end
|
27
|
-
|
28
|
-
elsif Concurrent.on_rbx? || Concurrent.on_truffle?
|
29
|
-
require 'monitor'
|
30
|
-
require 'concurrent/thread_safe/util/array_hash_rbx'
|
31
|
-
|
32
|
-
# @!macro concurrent_array
|
33
|
-
class Array < ::Array
|
34
|
-
end
|
35
|
-
|
36
|
-
ThreadSafe::Util.make_synchronized_on_rbx Array
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|