concurrent-ruby 1.1.5 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +84 -1
- data/Gemfile +5 -10
- data/{LICENSE.md → LICENSE.txt} +18 -20
- data/README.md +55 -31
- data/Rakefile +84 -92
- data/ext/concurrent-ruby/com/concurrent_ruby/ext/JavaAtomicFixnumLibrary.java +0 -0
- data/ext/concurrent-ruby/com/concurrent_ruby/ext/JavaSemaphoreLibrary.java +52 -22
- data/ext/concurrent-ruby/com/concurrent_ruby/ext/SynchronizationLibrary.java +10 -25
- data/lib/{concurrent → concurrent-ruby/concurrent}/agent.rb +2 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/array.rb +6 -16
- data/lib/{concurrent → concurrent-ruby/concurrent}/async.rb +10 -20
- data/lib/{concurrent → concurrent-ruby/concurrent}/atom.rb +2 -2
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/atomic_boolean.rb +7 -6
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/atomic_fixnum.rb +5 -4
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/atomic_markable_reference.rb +3 -0
- data/lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb +135 -0
- 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-ruby/concurrent/atomic/fiber_local_var.rb +109 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/java_count_down_latch.rb +1 -0
- data/lib/concurrent-ruby/concurrent/atomic/locals.rb +189 -0
- data/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb +28 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/mutex_atomic_boolean.rb +11 -5
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/mutex_atomic_fixnum.rb +11 -5
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/mutex_count_down_latch.rb +1 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/mutex_semaphore.rb +19 -3
- 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 +9 -9
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/semaphore.rb +32 -14
- data/lib/concurrent-ruby/concurrent/atomic/thread_local_var.rb +111 -0
- data/lib/concurrent-ruby/concurrent/atomic_reference/atomic_direct_update.rb +37 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic_reference/mutex_atomic.rb +15 -4
- data/lib/{concurrent → concurrent-ruby/concurrent}/collection/copy_on_notify_observer_set.rb +1 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/collection/copy_on_write_observer_set.rb +1 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/collection/lock_free_stack.rb +2 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/collection/map/mri_map_backend.rb +3 -3
- data/lib/{concurrent → concurrent-ruby/concurrent}/collection/map/non_concurrent_map_backend.rb +16 -8
- data/lib/concurrent-ruby/concurrent/collection/map/truffleruby_map_backend.rb +14 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/collection/ruby_non_concurrent_priority_queue.rb +11 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/concern/dereferenceable.rb +2 -2
- data/lib/concurrent-ruby/concurrent/concern/logging.rb +116 -0
- data/lib/concurrent-ruby/concurrent/concurrent_ruby.jar +0 -0
- data/lib/concurrent-ruby/concurrent/configuration.rb +105 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/delay.rb +2 -2
- data/lib/{concurrent → concurrent-ruby/concurrent}/errors.rb +5 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/exchanger.rb +1 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/abstract_executor_service.rb +34 -37
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/cached_thread_pool.rb +4 -4
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/executor_service.rb +2 -2
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/fixed_thread_pool.rb +29 -15
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/java_executor_service.rb +21 -9
- 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 +19 -2
- 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 +6 -6
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/serialized_execution.rb +1 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/simple_executor_service.rb +5 -2
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/single_thread_executor.rb +1 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/thread_pool_executor.rb +2 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/executor/timer_set.rb +0 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/hash.rb +1 -10
- data/lib/{concurrent → concurrent-ruby/concurrent}/immutable_struct.rb +10 -2
- data/lib/{concurrent → concurrent-ruby/concurrent}/ivar.rb +2 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/map.rb +44 -31
- data/lib/{concurrent → concurrent-ruby/concurrent}/maybe.rb +1 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/mutable_struct.rb +13 -3
- data/lib/{concurrent → concurrent-ruby/concurrent}/mvar.rb +1 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/promise.rb +2 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/promises.rb +7 -6
- data/lib/{concurrent → concurrent-ruby/concurrent}/re_include.rb +2 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/scheduled_task.rb +30 -17
- data/lib/{concurrent → concurrent-ruby/concurrent}/set.rb +17 -19
- data/lib/{concurrent → concurrent-ruby/concurrent}/settable_struct.rb +13 -3
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/abstract_lockable_object.rb +5 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/abstract_object.rb +1 -3
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/abstract_struct.rb +11 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/condition.rb +2 -0
- data/lib/concurrent-ruby/concurrent/synchronization/full_memory_barrier.rb +29 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/jruby_lockable_object.rb +3 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/lock.rb +2 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/lockable_object.rb +8 -7
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/mutex_lockable_object.rb +18 -5
- data/lib/{concurrent → concurrent-ruby/concurrent}/synchronization/object.rb +12 -44
- data/lib/concurrent-ruby/concurrent/synchronization/safe_initialization.rb +36 -0
- data/lib/concurrent-ruby/concurrent/synchronization/volatile.rb +101 -0
- data/lib/concurrent-ruby/concurrent/synchronization.rb +13 -0
- data/lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb +47 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/util/cheap_lockable.rb +2 -39
- data/lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb +52 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/thread_safe/util/striped64.rb +1 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/timer_task.rb +11 -34
- data/lib/{concurrent → concurrent-ruby/concurrent}/tuple.rb +1 -5
- data/lib/{concurrent → concurrent-ruby/concurrent}/tvar.rb +21 -57
- data/lib/{concurrent → concurrent-ruby/concurrent}/utility/engine.rb +5 -16
- data/lib/concurrent-ruby/concurrent/utility/monotonic_time.rb +19 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/utility/native_extension_loader.rb +8 -10
- data/lib/{concurrent → concurrent-ruby/concurrent}/utility/native_integer.rb +1 -0
- data/lib/concurrent-ruby/concurrent/utility/processor_counter.rb +110 -0
- data/lib/concurrent-ruby/concurrent/version.rb +3 -0
- data/lib/concurrent-ruby/concurrent-ruby.rb +5 -0
- metadata +127 -129
- data/lib/concurrent/atomic/abstract_thread_local_var.rb +0 -66
- data/lib/concurrent/atomic/atomic_reference.rb +0 -204
- data/lib/concurrent/atomic/java_thread_local_var.rb +0 -37
- data/lib/concurrent/atomic/ruby_thread_local_var.rb +0 -161
- data/lib/concurrent/atomic/thread_local_var.rb +0 -104
- data/lib/concurrent/concern/logging.rb +0 -32
- data/lib/concurrent/concurrent_ruby.jar +0 -0
- data/lib/concurrent/configuration.rb +0 -184
- data/lib/concurrent/synchronization/jruby_object.rb +0 -45
- data/lib/concurrent/synchronization/mri_object.rb +0 -44
- data/lib/concurrent/synchronization/rbx_lockable_object.rb +0 -65
- data/lib/concurrent/synchronization/rbx_object.rb +0 -49
- data/lib/concurrent/synchronization/truffleruby_object.rb +0 -47
- data/lib/concurrent/synchronization/volatile.rb +0 -36
- data/lib/concurrent/synchronization.rb +0 -30
- data/lib/concurrent/thread_safe/synchronized_delegator.rb +0 -50
- data/lib/concurrent/thread_safe/util/data_structures.rb +0 -63
- data/lib/concurrent/utility/at_exit.rb +0 -97
- data/lib/concurrent/utility/monotonic_time.rb +0 -58
- data/lib/concurrent/utility/processor_counter.rb +0 -158
- data/lib/concurrent/version.rb +0 -3
- data/lib/concurrent-ruby.rb +0 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic/count_down_latch.rb +1 -1
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomic_reference/numeric_cas_wrapper.rb +0 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/atomics.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/atomic_reference_map_backend.rb +0 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/collection/map/synchronized_map_backend.rb +0 -0
- data/lib/{concurrent → concurrent-ruby/concurrent}/collection/non_concurrent_priority_queue.rb +1 -1
- /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}/concern/observable.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/constants.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/dataflow.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_delegator.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/executors.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/future.rb +0 -0
- /data/lib/{concurrent → concurrent-ruby/concurrent}/options.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/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.rb → concurrent-ruby/concurrent.rb} +0 -0
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: concurrent-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jerry D'Antonio
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2023-02-24 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.
|
@@ -20,12 +20,12 @@ executables: []
|
|
20
20
|
extensions: []
|
21
21
|
extra_rdoc_files:
|
22
22
|
- README.md
|
23
|
-
- LICENSE.
|
23
|
+
- LICENSE.txt
|
24
24
|
- CHANGELOG.md
|
25
25
|
files:
|
26
26
|
- CHANGELOG.md
|
27
27
|
- Gemfile
|
28
|
-
- LICENSE.
|
28
|
+
- LICENSE.txt
|
29
29
|
- README.md
|
30
30
|
- Rakefile
|
31
31
|
- ext/concurrent-ruby/ConcurrentRubyService.java
|
@@ -43,149 +43,147 @@ files:
|
|
43
43
|
- ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/LongAdder.java
|
44
44
|
- ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/Striped64.java
|
45
45
|
- ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166y/ThreadLocalRandom.java
|
46
|
-
- lib/concurrent-ruby.rb
|
47
|
-
- lib/concurrent.rb
|
48
|
-
- lib/concurrent/agent.rb
|
49
|
-
- lib/concurrent/array.rb
|
50
|
-
- lib/concurrent/async.rb
|
51
|
-
- lib/concurrent/atom.rb
|
52
|
-
- lib/concurrent/atomic/
|
53
|
-
- lib/concurrent/atomic/
|
54
|
-
- lib/concurrent/atomic/
|
55
|
-
- lib/concurrent/atomic/
|
56
|
-
- lib/concurrent/atomic/
|
57
|
-
- lib/concurrent/atomic/
|
58
|
-
- lib/concurrent/atomic/
|
59
|
-
- lib/concurrent/atomic/
|
60
|
-
- lib/concurrent/atomic/java_count_down_latch.rb
|
61
|
-
- lib/concurrent/atomic/
|
62
|
-
- lib/concurrent/atomic/
|
63
|
-
- lib/concurrent/atomic/
|
64
|
-
- lib/concurrent/atomic/
|
65
|
-
- lib/concurrent/atomic/
|
66
|
-
- lib/concurrent/atomic/
|
67
|
-
- lib/concurrent/atomic/
|
68
|
-
- lib/concurrent/atomic/
|
69
|
-
- lib/concurrent/atomic/semaphore.rb
|
70
|
-
- lib/concurrent/atomic/thread_local_var.rb
|
71
|
-
- lib/concurrent/atomic_reference/
|
72
|
-
- lib/concurrent/atomic_reference/
|
73
|
-
- lib/concurrent/
|
74
|
-
- lib/concurrent/
|
75
|
-
- lib/concurrent/collection/
|
76
|
-
- lib/concurrent/collection/
|
77
|
-
- lib/concurrent/collection/
|
78
|
-
- lib/concurrent/collection/
|
79
|
-
- lib/concurrent/collection/map/
|
80
|
-
- lib/concurrent/collection/map/
|
81
|
-
- lib/concurrent/collection/map/
|
82
|
-
- lib/concurrent/collection/
|
83
|
-
- lib/concurrent/collection/
|
84
|
-
- lib/concurrent/
|
85
|
-
- lib/concurrent/
|
86
|
-
- lib/concurrent/concern/
|
87
|
-
- lib/concurrent/concern/
|
88
|
-
- lib/concurrent/concern/
|
89
|
-
- lib/concurrent/
|
90
|
-
- lib/concurrent/
|
91
|
-
- lib/concurrent/
|
92
|
-
- lib/concurrent/
|
93
|
-
- lib/concurrent/
|
94
|
-
- lib/concurrent/
|
95
|
-
- lib/concurrent/
|
96
|
-
- lib/concurrent/
|
97
|
-
- lib/concurrent/
|
98
|
-
- lib/concurrent/executor/
|
99
|
-
- lib/concurrent/executor/
|
100
|
-
- lib/concurrent/executor/
|
101
|
-
- lib/concurrent/executor/
|
102
|
-
- lib/concurrent/executor/
|
103
|
-
- lib/concurrent/executor/
|
104
|
-
- lib/concurrent/executor/
|
105
|
-
- lib/concurrent/executor/
|
106
|
-
- lib/concurrent/executor/
|
107
|
-
- lib/concurrent/executor/
|
108
|
-
- lib/concurrent/executor/
|
109
|
-
- lib/concurrent/executor/
|
110
|
-
- lib/concurrent/executor/
|
111
|
-
- lib/concurrent/executor/
|
112
|
-
- lib/concurrent/executor/
|
113
|
-
- lib/concurrent/executor/
|
114
|
-
- lib/concurrent/executor/
|
115
|
-
- lib/concurrent/executor/
|
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/
|
133
|
-
- lib/concurrent/
|
134
|
-
- lib/concurrent/synchronization
|
135
|
-
- lib/concurrent/synchronization/
|
136
|
-
- lib/concurrent/synchronization/
|
137
|
-
- lib/concurrent/synchronization/
|
138
|
-
- lib/concurrent/synchronization/
|
139
|
-
- lib/concurrent/synchronization/
|
140
|
-
- lib/concurrent/synchronization/
|
141
|
-
- lib/concurrent/synchronization/
|
142
|
-
- lib/concurrent/synchronization/
|
143
|
-
- lib/concurrent/synchronization/
|
144
|
-
- lib/concurrent/synchronization/
|
145
|
-
- lib/concurrent/synchronization/
|
146
|
-
- lib/concurrent/synchronization/
|
147
|
-
- lib/concurrent/
|
148
|
-
- lib/concurrent/thread_safe/
|
149
|
-
- lib/concurrent/thread_safe/util.rb
|
150
|
-
- lib/concurrent/thread_safe/util/
|
151
|
-
- lib/concurrent/thread_safe/util/
|
152
|
-
- lib/concurrent/thread_safe/util/
|
153
|
-
- lib/concurrent/thread_safe/util/
|
154
|
-
- lib/concurrent/thread_safe/util/
|
155
|
-
- lib/concurrent/thread_safe/util/
|
156
|
-
- lib/concurrent/
|
157
|
-
- lib/concurrent/
|
158
|
-
- lib/concurrent/
|
159
|
-
- lib/concurrent/
|
160
|
-
- lib/concurrent/utility/
|
161
|
-
- lib/concurrent/utility/
|
162
|
-
- lib/concurrent/utility/
|
163
|
-
- lib/concurrent/utility/
|
164
|
-
- lib/concurrent/
|
165
|
-
- lib/concurrent/utility/processor_counter.rb
|
166
|
-
- lib/concurrent/version.rb
|
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/atomic_boolean.rb
|
53
|
+
- lib/concurrent-ruby/concurrent/atomic/atomic_fixnum.rb
|
54
|
+
- lib/concurrent-ruby/concurrent/atomic/atomic_markable_reference.rb
|
55
|
+
- lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb
|
56
|
+
- lib/concurrent-ruby/concurrent/atomic/count_down_latch.rb
|
57
|
+
- lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb
|
58
|
+
- lib/concurrent-ruby/concurrent/atomic/event.rb
|
59
|
+
- lib/concurrent-ruby/concurrent/atomic/fiber_local_var.rb
|
60
|
+
- lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
|
61
|
+
- lib/concurrent-ruby/concurrent/atomic/locals.rb
|
62
|
+
- lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb
|
63
|
+
- lib/concurrent-ruby/concurrent/atomic/mutex_atomic_boolean.rb
|
64
|
+
- lib/concurrent-ruby/concurrent/atomic/mutex_atomic_fixnum.rb
|
65
|
+
- lib/concurrent-ruby/concurrent/atomic/mutex_count_down_latch.rb
|
66
|
+
- lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb
|
67
|
+
- lib/concurrent-ruby/concurrent/atomic/read_write_lock.rb
|
68
|
+
- lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.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/atomic_direct_update.rb
|
72
|
+
- lib/concurrent-ruby/concurrent/atomic_reference/mutex_atomic.rb
|
73
|
+
- lib/concurrent-ruby/concurrent/atomic_reference/numeric_cas_wrapper.rb
|
74
|
+
- lib/concurrent-ruby/concurrent/atomics.rb
|
75
|
+
- lib/concurrent-ruby/concurrent/collection/copy_on_notify_observer_set.rb
|
76
|
+
- lib/concurrent-ruby/concurrent/collection/copy_on_write_observer_set.rb
|
77
|
+
- lib/concurrent-ruby/concurrent/collection/java_non_concurrent_priority_queue.rb
|
78
|
+
- lib/concurrent-ruby/concurrent/collection/lock_free_stack.rb
|
79
|
+
- lib/concurrent-ruby/concurrent/collection/map/atomic_reference_map_backend.rb
|
80
|
+
- lib/concurrent-ruby/concurrent/collection/map/mri_map_backend.rb
|
81
|
+
- lib/concurrent-ruby/concurrent/collection/map/non_concurrent_map_backend.rb
|
82
|
+
- lib/concurrent-ruby/concurrent/collection/map/synchronized_map_backend.rb
|
83
|
+
- lib/concurrent-ruby/concurrent/collection/map/truffleruby_map_backend.rb
|
84
|
+
- lib/concurrent-ruby/concurrent/collection/non_concurrent_priority_queue.rb
|
85
|
+
- lib/concurrent-ruby/concurrent/collection/ruby_non_concurrent_priority_queue.rb
|
86
|
+
- lib/concurrent-ruby/concurrent/concern/deprecation.rb
|
87
|
+
- lib/concurrent-ruby/concurrent/concern/dereferenceable.rb
|
88
|
+
- lib/concurrent-ruby/concurrent/concern/logging.rb
|
89
|
+
- lib/concurrent-ruby/concurrent/concern/obligation.rb
|
90
|
+
- lib/concurrent-ruby/concurrent/concern/observable.rb
|
91
|
+
- lib/concurrent-ruby/concurrent/concurrent_ruby.jar
|
92
|
+
- lib/concurrent-ruby/concurrent/configuration.rb
|
93
|
+
- lib/concurrent-ruby/concurrent/constants.rb
|
94
|
+
- lib/concurrent-ruby/concurrent/dataflow.rb
|
95
|
+
- lib/concurrent-ruby/concurrent/delay.rb
|
96
|
+
- lib/concurrent-ruby/concurrent/errors.rb
|
97
|
+
- lib/concurrent-ruby/concurrent/exchanger.rb
|
98
|
+
- lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb
|
99
|
+
- lib/concurrent-ruby/concurrent/executor/cached_thread_pool.rb
|
100
|
+
- lib/concurrent-ruby/concurrent/executor/executor_service.rb
|
101
|
+
- lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb
|
102
|
+
- lib/concurrent-ruby/concurrent/executor/immediate_executor.rb
|
103
|
+
- lib/concurrent-ruby/concurrent/executor/indirect_immediate_executor.rb
|
104
|
+
- lib/concurrent-ruby/concurrent/executor/java_executor_service.rb
|
105
|
+
- lib/concurrent-ruby/concurrent/executor/java_single_thread_executor.rb
|
106
|
+
- lib/concurrent-ruby/concurrent/executor/java_thread_pool_executor.rb
|
107
|
+
- lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb
|
108
|
+
- lib/concurrent-ruby/concurrent/executor/ruby_single_thread_executor.rb
|
109
|
+
- lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb
|
110
|
+
- lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb
|
111
|
+
- lib/concurrent-ruby/concurrent/executor/serial_executor_service.rb
|
112
|
+
- lib/concurrent-ruby/concurrent/executor/serialized_execution.rb
|
113
|
+
- lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb
|
114
|
+
- lib/concurrent-ruby/concurrent/executor/simple_executor_service.rb
|
115
|
+
- lib/concurrent-ruby/concurrent/executor/single_thread_executor.rb
|
116
|
+
- lib/concurrent-ruby/concurrent/executor/thread_pool_executor.rb
|
117
|
+
- lib/concurrent-ruby/concurrent/executor/timer_set.rb
|
118
|
+
- lib/concurrent-ruby/concurrent/executors.rb
|
119
|
+
- lib/concurrent-ruby/concurrent/future.rb
|
120
|
+
- lib/concurrent-ruby/concurrent/hash.rb
|
121
|
+
- lib/concurrent-ruby/concurrent/immutable_struct.rb
|
122
|
+
- lib/concurrent-ruby/concurrent/ivar.rb
|
123
|
+
- lib/concurrent-ruby/concurrent/map.rb
|
124
|
+
- lib/concurrent-ruby/concurrent/maybe.rb
|
125
|
+
- lib/concurrent-ruby/concurrent/mutable_struct.rb
|
126
|
+
- lib/concurrent-ruby/concurrent/mvar.rb
|
127
|
+
- lib/concurrent-ruby/concurrent/options.rb
|
128
|
+
- lib/concurrent-ruby/concurrent/promise.rb
|
129
|
+
- lib/concurrent-ruby/concurrent/promises.rb
|
130
|
+
- lib/concurrent-ruby/concurrent/re_include.rb
|
131
|
+
- lib/concurrent-ruby/concurrent/scheduled_task.rb
|
132
|
+
- lib/concurrent-ruby/concurrent/set.rb
|
133
|
+
- lib/concurrent-ruby/concurrent/settable_struct.rb
|
134
|
+
- lib/concurrent-ruby/concurrent/synchronization.rb
|
135
|
+
- lib/concurrent-ruby/concurrent/synchronization/abstract_lockable_object.rb
|
136
|
+
- lib/concurrent-ruby/concurrent/synchronization/abstract_object.rb
|
137
|
+
- lib/concurrent-ruby/concurrent/synchronization/abstract_struct.rb
|
138
|
+
- lib/concurrent-ruby/concurrent/synchronization/condition.rb
|
139
|
+
- lib/concurrent-ruby/concurrent/synchronization/full_memory_barrier.rb
|
140
|
+
- lib/concurrent-ruby/concurrent/synchronization/jruby_lockable_object.rb
|
141
|
+
- lib/concurrent-ruby/concurrent/synchronization/lock.rb
|
142
|
+
- lib/concurrent-ruby/concurrent/synchronization/lockable_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/safe_initialization.rb
|
146
|
+
- lib/concurrent-ruby/concurrent/synchronization/volatile.rb
|
147
|
+
- lib/concurrent-ruby/concurrent/thread_safe/synchronized_delegator.rb
|
148
|
+
- lib/concurrent-ruby/concurrent/thread_safe/util.rb
|
149
|
+
- lib/concurrent-ruby/concurrent/thread_safe/util/adder.rb
|
150
|
+
- lib/concurrent-ruby/concurrent/thread_safe/util/cheap_lockable.rb
|
151
|
+
- lib/concurrent-ruby/concurrent/thread_safe/util/data_structures.rb
|
152
|
+
- lib/concurrent-ruby/concurrent/thread_safe/util/power_of_two_tuple.rb
|
153
|
+
- lib/concurrent-ruby/concurrent/thread_safe/util/striped64.rb
|
154
|
+
- lib/concurrent-ruby/concurrent/thread_safe/util/volatile.rb
|
155
|
+
- lib/concurrent-ruby/concurrent/thread_safe/util/xor_shift_random.rb
|
156
|
+
- lib/concurrent-ruby/concurrent/timer_task.rb
|
157
|
+
- lib/concurrent-ruby/concurrent/tuple.rb
|
158
|
+
- lib/concurrent-ruby/concurrent/tvar.rb
|
159
|
+
- lib/concurrent-ruby/concurrent/utility/engine.rb
|
160
|
+
- lib/concurrent-ruby/concurrent/utility/monotonic_time.rb
|
161
|
+
- lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb
|
162
|
+
- lib/concurrent-ruby/concurrent/utility/native_integer.rb
|
163
|
+
- lib/concurrent-ruby/concurrent/utility/processor_counter.rb
|
164
|
+
- lib/concurrent-ruby/concurrent/version.rb
|
167
165
|
homepage: http://www.concurrent-ruby.com
|
168
166
|
licenses:
|
169
167
|
- MIT
|
170
168
|
metadata:
|
171
169
|
source_code_uri: https://github.com/ruby-concurrency/concurrent-ruby
|
170
|
+
changelog_uri: https://github.com/ruby-concurrency/concurrent-ruby/blob/master/CHANGELOG.md
|
172
171
|
post_install_message:
|
173
172
|
rdoc_options: []
|
174
173
|
require_paths:
|
175
|
-
- lib
|
174
|
+
- lib/concurrent-ruby
|
176
175
|
required_ruby_version: !ruby/object:Gem::Requirement
|
177
176
|
requirements:
|
178
177
|
- - ">="
|
179
178
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
179
|
+
version: '2.3'
|
181
180
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
181
|
requirements:
|
183
182
|
- - ">="
|
184
183
|
- !ruby/object:Gem::Version
|
185
184
|
version: '0'
|
186
185
|
requirements: []
|
187
|
-
|
188
|
-
rubygems_version: 2.7.8
|
186
|
+
rubygems_version: 3.3.26
|
189
187
|
signing_key:
|
190
188
|
specification_version: 4
|
191
189
|
summary: Modern concurrency tools for Ruby. Inspired by Erlang, Clojure, Scala, Haskell,
|
@@ -1,66 +0,0 @@
|
|
1
|
-
require 'concurrent/constants'
|
2
|
-
|
3
|
-
module Concurrent
|
4
|
-
|
5
|
-
# @!macro thread_local_var
|
6
|
-
# @!macro internal_implementation_note
|
7
|
-
# @!visibility private
|
8
|
-
class AbstractThreadLocalVar
|
9
|
-
|
10
|
-
# @!macro thread_local_var_method_initialize
|
11
|
-
def initialize(default = nil, &default_block)
|
12
|
-
if default && block_given?
|
13
|
-
raise ArgumentError, "Cannot use both value and block as default value"
|
14
|
-
end
|
15
|
-
|
16
|
-
if block_given?
|
17
|
-
@default_block = default_block
|
18
|
-
@default = nil
|
19
|
-
else
|
20
|
-
@default_block = nil
|
21
|
-
@default = default
|
22
|
-
end
|
23
|
-
|
24
|
-
allocate_storage
|
25
|
-
end
|
26
|
-
|
27
|
-
# @!macro thread_local_var_method_get
|
28
|
-
def value
|
29
|
-
raise NotImplementedError
|
30
|
-
end
|
31
|
-
|
32
|
-
# @!macro thread_local_var_method_set
|
33
|
-
def value=(value)
|
34
|
-
raise NotImplementedError
|
35
|
-
end
|
36
|
-
|
37
|
-
# @!macro thread_local_var_method_bind
|
38
|
-
def bind(value, &block)
|
39
|
-
if block_given?
|
40
|
-
old_value = self.value
|
41
|
-
begin
|
42
|
-
self.value = value
|
43
|
-
yield
|
44
|
-
ensure
|
45
|
-
self.value = old_value
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
protected
|
51
|
-
|
52
|
-
# @!visibility private
|
53
|
-
def allocate_storage
|
54
|
-
raise NotImplementedError
|
55
|
-
end
|
56
|
-
|
57
|
-
# @!visibility private
|
58
|
-
def default
|
59
|
-
if @default_block
|
60
|
-
self.value = @default_block.call
|
61
|
-
else
|
62
|
-
@default
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
@@ -1,204 +0,0 @@
|
|
1
|
-
require 'concurrent/synchronization'
|
2
|
-
require 'concurrent/utility/engine'
|
3
|
-
require 'concurrent/atomic_reference/numeric_cas_wrapper'
|
4
|
-
|
5
|
-
# Shim for TruffleRuby::AtomicReference
|
6
|
-
if Concurrent.on_truffleruby? && !defined?(TruffleRuby::AtomicReference)
|
7
|
-
# @!visibility private
|
8
|
-
module TruffleRuby
|
9
|
-
AtomicReference = Truffle::AtomicReference
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
module Concurrent
|
14
|
-
|
15
|
-
# Define update methods that use direct paths
|
16
|
-
#
|
17
|
-
# @!visibility private
|
18
|
-
# @!macro internal_implementation_note
|
19
|
-
module AtomicDirectUpdate
|
20
|
-
|
21
|
-
# @!macro atomic_reference_method_update
|
22
|
-
#
|
23
|
-
# Pass the current value to the given block, replacing it
|
24
|
-
# with the block's result. May retry if the value changes
|
25
|
-
# during the block's execution.
|
26
|
-
#
|
27
|
-
# @yield [Object] Calculate a new value for the atomic reference using
|
28
|
-
# given (old) value
|
29
|
-
# @yieldparam [Object] old_value the starting value of the atomic reference
|
30
|
-
# @return [Object] the new value
|
31
|
-
def update
|
32
|
-
true until compare_and_set(old_value = get, new_value = yield(old_value))
|
33
|
-
new_value
|
34
|
-
end
|
35
|
-
|
36
|
-
# @!macro atomic_reference_method_try_update
|
37
|
-
#
|
38
|
-
# Pass the current value to the given block, replacing it
|
39
|
-
# with the block's result. Return nil if the update fails.
|
40
|
-
#
|
41
|
-
# @yield [Object] Calculate a new value for the atomic reference using
|
42
|
-
# given (old) value
|
43
|
-
# @yieldparam [Object] old_value the starting value of the atomic reference
|
44
|
-
# @note This method was altered to avoid raising an exception by default.
|
45
|
-
# Instead, this method now returns `nil` in case of failure. For more info,
|
46
|
-
# please see: https://github.com/ruby-concurrency/concurrent-ruby/pull/336
|
47
|
-
# @return [Object] the new value, or nil if update failed
|
48
|
-
def try_update
|
49
|
-
old_value = get
|
50
|
-
new_value = yield old_value
|
51
|
-
|
52
|
-
return unless compare_and_set old_value, new_value
|
53
|
-
|
54
|
-
new_value
|
55
|
-
end
|
56
|
-
|
57
|
-
# @!macro atomic_reference_method_try_update!
|
58
|
-
#
|
59
|
-
# Pass the current value to the given block, replacing it
|
60
|
-
# with the block's result. Raise an exception if the update
|
61
|
-
# fails.
|
62
|
-
#
|
63
|
-
# @yield [Object] Calculate a new value for the atomic reference using
|
64
|
-
# given (old) value
|
65
|
-
# @yieldparam [Object] old_value the starting value of the atomic reference
|
66
|
-
# @note This behavior mimics the behavior of the original
|
67
|
-
# `AtomicReference#try_update` API. The reason this was changed was to
|
68
|
-
# avoid raising exceptions (which are inherently slow) by default. For more
|
69
|
-
# info: https://github.com/ruby-concurrency/concurrent-ruby/pull/336
|
70
|
-
# @return [Object] the new value
|
71
|
-
# @raise [Concurrent::ConcurrentUpdateError] if the update fails
|
72
|
-
def try_update!
|
73
|
-
old_value = get
|
74
|
-
new_value = yield old_value
|
75
|
-
unless compare_and_set(old_value, new_value)
|
76
|
-
if $VERBOSE
|
77
|
-
raise ConcurrentUpdateError, "Update failed"
|
78
|
-
else
|
79
|
-
raise ConcurrentUpdateError, "Update failed", ConcurrentUpdateError::CONC_UP_ERR_BACKTRACE
|
80
|
-
end
|
81
|
-
end
|
82
|
-
new_value
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
require 'concurrent/atomic_reference/mutex_atomic'
|
87
|
-
|
88
|
-
# @!macro atomic_reference
|
89
|
-
#
|
90
|
-
# An object reference that may be updated atomically. All read and write
|
91
|
-
# operations have java volatile semantic.
|
92
|
-
#
|
93
|
-
# @!macro thread_safe_variable_comparison
|
94
|
-
#
|
95
|
-
# @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/AtomicReference.html
|
96
|
-
# @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/package-summary.html
|
97
|
-
#
|
98
|
-
# @!method initialize(value = nil)
|
99
|
-
# @!macro atomic_reference_method_initialize
|
100
|
-
# @param [Object] value The initial value.
|
101
|
-
#
|
102
|
-
# @!method get
|
103
|
-
# @!macro atomic_reference_method_get
|
104
|
-
# Gets the current value.
|
105
|
-
# @return [Object] the current value
|
106
|
-
#
|
107
|
-
# @!method set(new_value)
|
108
|
-
# @!macro atomic_reference_method_set
|
109
|
-
# Sets to the given value.
|
110
|
-
# @param [Object] new_value the new value
|
111
|
-
# @return [Object] the new value
|
112
|
-
#
|
113
|
-
# @!method get_and_set(new_value)
|
114
|
-
# @!macro atomic_reference_method_get_and_set
|
115
|
-
# Atomically sets to the given value and returns the old value.
|
116
|
-
# @param [Object] new_value the new value
|
117
|
-
# @return [Object] the old value
|
118
|
-
#
|
119
|
-
# @!method compare_and_set(old_value, new_value)
|
120
|
-
# @!macro atomic_reference_method_compare_and_set
|
121
|
-
#
|
122
|
-
# Atomically sets the value to the given updated value if
|
123
|
-
# the current value == the expected value.
|
124
|
-
#
|
125
|
-
# @param [Object] old_value the expected value
|
126
|
-
# @param [Object] new_value the new value
|
127
|
-
#
|
128
|
-
# @return [Boolean] `true` if successful. A `false` return indicates
|
129
|
-
# that the actual value was not equal to the expected value.
|
130
|
-
#
|
131
|
-
# @!method update
|
132
|
-
# @!macro atomic_reference_method_update
|
133
|
-
#
|
134
|
-
# @!method try_update
|
135
|
-
# @!macro atomic_reference_method_try_update
|
136
|
-
#
|
137
|
-
# @!method try_update!
|
138
|
-
# @!macro atomic_reference_method_try_update!
|
139
|
-
|
140
|
-
|
141
|
-
# @!macro internal_implementation_note
|
142
|
-
class ConcurrentUpdateError < ThreadError
|
143
|
-
# frozen pre-allocated backtrace to speed ConcurrentUpdateError
|
144
|
-
CONC_UP_ERR_BACKTRACE = ['backtrace elided; set verbose to enable'].freeze
|
145
|
-
end
|
146
|
-
|
147
|
-
# @!macro internal_implementation_note
|
148
|
-
AtomicReferenceImplementation = case
|
149
|
-
when Concurrent.on_cruby? && Concurrent.c_extensions_loaded?
|
150
|
-
# @!visibility private
|
151
|
-
# @!macro internal_implementation_note
|
152
|
-
class CAtomicReference
|
153
|
-
include AtomicDirectUpdate
|
154
|
-
include AtomicNumericCompareAndSetWrapper
|
155
|
-
alias_method :compare_and_swap, :compare_and_set
|
156
|
-
end
|
157
|
-
CAtomicReference
|
158
|
-
when Concurrent.on_jruby?
|
159
|
-
# @!visibility private
|
160
|
-
# @!macro internal_implementation_note
|
161
|
-
class JavaAtomicReference
|
162
|
-
include AtomicDirectUpdate
|
163
|
-
end
|
164
|
-
JavaAtomicReference
|
165
|
-
when Concurrent.on_truffleruby?
|
166
|
-
class TruffleRubyAtomicReference < TruffleRuby::AtomicReference
|
167
|
-
include AtomicDirectUpdate
|
168
|
-
alias_method :value, :get
|
169
|
-
alias_method :value=, :set
|
170
|
-
alias_method :compare_and_swap, :compare_and_set
|
171
|
-
alias_method :swap, :get_and_set
|
172
|
-
end
|
173
|
-
when Concurrent.on_rbx?
|
174
|
-
# @note Extends `Rubinius::AtomicReference` version adding aliases
|
175
|
-
# and numeric logic.
|
176
|
-
#
|
177
|
-
# @!visibility private
|
178
|
-
# @!macro internal_implementation_note
|
179
|
-
class RbxAtomicReference < Rubinius::AtomicReference
|
180
|
-
alias_method :_compare_and_set, :compare_and_set
|
181
|
-
include AtomicDirectUpdate
|
182
|
-
include AtomicNumericCompareAndSetWrapper
|
183
|
-
alias_method :value, :get
|
184
|
-
alias_method :value=, :set
|
185
|
-
alias_method :swap, :get_and_set
|
186
|
-
alias_method :compare_and_swap, :compare_and_set
|
187
|
-
end
|
188
|
-
RbxAtomicReference
|
189
|
-
else
|
190
|
-
MutexAtomicReference
|
191
|
-
end
|
192
|
-
private_constant :AtomicReferenceImplementation
|
193
|
-
|
194
|
-
# @!macro atomic_reference
|
195
|
-
class AtomicReference < AtomicReferenceImplementation
|
196
|
-
|
197
|
-
# @return [String] Short string representation.
|
198
|
-
def to_s
|
199
|
-
format '%s value:%s>', super[0..-2], get
|
200
|
-
end
|
201
|
-
|
202
|
-
alias_method :inspect, :to_s
|
203
|
-
end
|
204
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'concurrent/atomic/abstract_thread_local_var'
|
2
|
-
|
3
|
-
if Concurrent.on_jruby?
|
4
|
-
|
5
|
-
module Concurrent
|
6
|
-
|
7
|
-
# @!visibility private
|
8
|
-
# @!macro internal_implementation_note
|
9
|
-
class JavaThreadLocalVar < AbstractThreadLocalVar
|
10
|
-
|
11
|
-
# @!macro thread_local_var_method_get
|
12
|
-
def value
|
13
|
-
value = @var.get
|
14
|
-
|
15
|
-
if value.nil?
|
16
|
-
default
|
17
|
-
elsif value == NULL
|
18
|
-
nil
|
19
|
-
else
|
20
|
-
value
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
# @!macro thread_local_var_method_set
|
25
|
-
def value=(value)
|
26
|
-
@var.set(value)
|
27
|
-
end
|
28
|
-
|
29
|
-
protected
|
30
|
-
|
31
|
-
# @!visibility private
|
32
|
-
def allocate_storage
|
33
|
-
@var = java.lang.ThreadLocal.new
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|