concurrent-ruby 1.0.5 → 1.1.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +42 -0
  3. data/Gemfile +39 -0
  4. data/{LICENSE.txt → LICENSE.md} +2 -0
  5. data/README.md +203 -105
  6. data/Rakefile +278 -0
  7. data/ext/concurrent-ruby/ConcurrentRubyService.java +17 -0
  8. data/ext/concurrent-ruby/com/concurrent_ruby/ext/AtomicReferenceLibrary.java +175 -0
  9. data/ext/concurrent-ruby/com/concurrent_ruby/ext/JRubyMapBackendLibrary.java +248 -0
  10. data/ext/concurrent-ruby/com/concurrent_ruby/ext/JavaAtomicBooleanLibrary.java +93 -0
  11. data/ext/concurrent-ruby/com/concurrent_ruby/ext/JavaAtomicFixnumLibrary.java +113 -0
  12. data/ext/concurrent-ruby/com/concurrent_ruby/ext/JavaSemaphoreLibrary.java +159 -0
  13. data/ext/concurrent-ruby/com/concurrent_ruby/ext/SynchronizationLibrary.java +304 -0
  14. data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/ConcurrentHashMap.java +31 -0
  15. data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/ConcurrentHashMapV8.java +3863 -0
  16. data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/LongAdder.java +203 -0
  17. data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/Striped64.java +342 -0
  18. data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/ConcurrentHashMapV8.java +3800 -0
  19. data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/LongAdder.java +204 -0
  20. data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166e/nounsafe/Striped64.java +291 -0
  21. data/ext/concurrent-ruby/com/concurrent_ruby/ext/jsr166y/ThreadLocalRandom.java +199 -0
  22. data/lib/concurrent-ruby.rb +1 -0
  23. data/lib/concurrent.rb +24 -20
  24. data/lib/concurrent/agent.rb +7 -7
  25. data/lib/concurrent/array.rb +59 -32
  26. data/lib/concurrent/async.rb +4 -4
  27. data/lib/concurrent/atom.rb +9 -9
  28. data/lib/concurrent/atomic/atomic_boolean.rb +24 -20
  29. data/lib/concurrent/atomic/atomic_fixnum.rb +27 -23
  30. data/lib/concurrent/atomic/atomic_markable_reference.rb +164 -0
  31. data/lib/concurrent/atomic/atomic_reference.rb +176 -33
  32. data/lib/concurrent/atomic/count_down_latch.rb +6 -6
  33. data/lib/concurrent/atomic/cyclic_barrier.rb +1 -1
  34. data/lib/concurrent/atomic/event.rb +1 -1
  35. data/lib/concurrent/atomic/java_count_down_latch.rb +6 -5
  36. data/lib/concurrent/atomic/mutex_count_down_latch.rb +1 -0
  37. data/lib/concurrent/atomic/read_write_lock.rb +2 -1
  38. data/lib/concurrent/atomic/reentrant_read_write_lock.rb +3 -1
  39. data/lib/concurrent/atomic/semaphore.rb +8 -8
  40. data/lib/concurrent/atomic/thread_local_var.rb +7 -7
  41. data/lib/concurrent/atomic_reference/mutex_atomic.rb +3 -8
  42. data/lib/concurrent/atomic_reference/numeric_cas_wrapper.rb +1 -1
  43. data/lib/concurrent/atomics.rb +0 -43
  44. data/lib/concurrent/collection/lock_free_stack.rb +127 -0
  45. data/lib/concurrent/collection/map/atomic_reference_map_backend.rb +3 -3
  46. data/lib/concurrent/collection/map/non_concurrent_map_backend.rb +1 -2
  47. data/lib/concurrent/collection/non_concurrent_priority_queue.rb +29 -29
  48. data/lib/concurrent/concern/dereferenceable.rb +1 -1
  49. data/lib/concurrent/concern/logging.rb +6 -1
  50. data/lib/concurrent/concern/observable.rb +7 -7
  51. data/lib/concurrent/concurrent_ruby.jar +0 -0
  52. data/lib/concurrent/configuration.rb +1 -6
  53. data/lib/concurrent/constants.rb +1 -1
  54. data/lib/concurrent/dataflow.rb +2 -1
  55. data/lib/concurrent/delay.rb +9 -7
  56. data/lib/concurrent/exchanger.rb +13 -21
  57. data/lib/concurrent/executor/abstract_executor_service.rb +2 -2
  58. data/lib/concurrent/executor/cached_thread_pool.rb +1 -1
  59. data/lib/concurrent/executor/executor_service.rb +15 -15
  60. data/lib/concurrent/executor/fixed_thread_pool.rb +18 -18
  61. data/lib/concurrent/executor/java_thread_pool_executor.rb +10 -7
  62. data/lib/concurrent/executor/single_thread_executor.rb +2 -2
  63. data/lib/concurrent/executor/thread_pool_executor.rb +6 -6
  64. data/lib/concurrent/executor/timer_set.rb +1 -1
  65. data/lib/concurrent/future.rb +4 -1
  66. data/lib/concurrent/hash.rb +53 -30
  67. data/lib/concurrent/ivar.rb +5 -6
  68. data/lib/concurrent/map.rb +20 -25
  69. data/lib/concurrent/maybe.rb +1 -1
  70. data/lib/concurrent/mutable_struct.rb +15 -14
  71. data/lib/concurrent/mvar.rb +2 -2
  72. data/lib/concurrent/promise.rb +53 -21
  73. data/lib/concurrent/promises.rb +1938 -0
  74. data/lib/concurrent/re_include.rb +58 -0
  75. data/lib/concurrent/set.rb +66 -0
  76. data/lib/concurrent/settable_struct.rb +1 -0
  77. data/lib/concurrent/synchronization.rb +4 -5
  78. data/lib/concurrent/synchronization/abstract_lockable_object.rb +5 -5
  79. data/lib/concurrent/synchronization/abstract_struct.rb +6 -4
  80. data/lib/concurrent/synchronization/lockable_object.rb +6 -6
  81. data/lib/concurrent/synchronization/{mri_lockable_object.rb → mutex_lockable_object.rb} +19 -14
  82. data/lib/concurrent/synchronization/object.rb +8 -4
  83. data/lib/concurrent/synchronization/truffleruby_object.rb +46 -0
  84. data/lib/concurrent/synchronization/volatile.rb +11 -9
  85. data/lib/concurrent/thread_safe/util/data_structures.rb +55 -0
  86. data/lib/concurrent/thread_safe/util/striped64.rb +9 -4
  87. data/lib/concurrent/timer_task.rb +5 -2
  88. data/lib/concurrent/tuple.rb +1 -1
  89. data/lib/concurrent/tvar.rb +2 -2
  90. data/lib/concurrent/utility/at_exit.rb +1 -1
  91. data/lib/concurrent/utility/engine.rb +2 -2
  92. data/lib/concurrent/utility/monotonic_time.rb +3 -3
  93. data/lib/concurrent/utility/native_extension_loader.rb +31 -33
  94. data/lib/concurrent/utility/processor_counter.rb +0 -2
  95. data/lib/concurrent/version.rb +2 -2
  96. metadata +35 -21
  97. data/lib/concurrent/atomic_reference/concurrent_update_error.rb +0 -8
  98. data/lib/concurrent/atomic_reference/direct_update.rb +0 -81
  99. data/lib/concurrent/atomic_reference/jruby+truffle.rb +0 -2
  100. data/lib/concurrent/atomic_reference/jruby.rb +0 -16
  101. data/lib/concurrent/atomic_reference/rbx.rb +0 -22
  102. data/lib/concurrent/atomic_reference/ruby.rb +0 -32
  103. data/lib/concurrent/edge.rb +0 -26
  104. data/lib/concurrent/lazy_register.rb +0 -81
  105. data/lib/concurrent/synchronization/truffle_lockable_object.rb +0 -9
  106. data/lib/concurrent/synchronization/truffle_object.rb +0 -31
  107. data/lib/concurrent/thread_safe/util/array_hash_rbx.rb +0 -30
@@ -3,6 +3,6 @@ module Concurrent
3
3
  # Various classes within allows for +nil+ values to be stored,
4
4
  # so a special +NULL+ token is required to indicate the "nil-ness".
5
5
  # @!visibility private
6
- NULL = Object.new
6
+ NULL = ::Object.new
7
7
 
8
8
  end
@@ -18,7 +18,8 @@ module Concurrent
18
18
  end
19
19
  end
20
20
 
21
- # {include:file:doc/dataflow.md}
21
+ # Dataflow allows you to create a task that will be scheduled when all of its data dependencies are available.
22
+ # {include:file:docs-source/dataflow.md}
22
23
  #
23
24
  # @param [Future] inputs zero or more `Future` operations that this dataflow depends upon
24
25
  #
@@ -32,7 +32,7 @@ module Concurrent
32
32
  #
33
33
  # @!macro copy_options
34
34
  #
35
- # @!macro [attach] delay_note_regarding_blocking
35
+ # @!macro delay_note_regarding_blocking
36
36
  # @note The default behavior of `Delay` is to block indefinitely when
37
37
  # calling either `value` or `wait`, executing the delayed operation on
38
38
  # the current thread. This makes the `timeout` value completely
@@ -81,13 +81,15 @@ module Concurrent
81
81
  # this function has been optimized for performance and
82
82
  # should not be modified without running new benchmarks
83
83
  synchronize do
84
- execute = @computing = true unless @computing
84
+ execute = @evaluation_started = true unless @evaluation_started
85
85
  if execute
86
86
  begin
87
87
  set_state(true, @task.call, nil)
88
88
  rescue => ex
89
89
  set_state(false, nil, ex)
90
90
  end
91
+ elsif incomplete?
92
+ raise IllegalOperationError, 'Recursive call to #value during evaluation of the Delay'
91
93
  end
92
94
  end
93
95
  if @do_nothing_on_deref
@@ -144,7 +146,7 @@ module Concurrent
144
146
  def reconfigure(&block)
145
147
  synchronize do
146
148
  raise ArgumentError.new('no block given') unless block_given?
147
- unless @computing
149
+ unless @evaluation_started
148
150
  @task = block
149
151
  true
150
152
  else
@@ -160,9 +162,9 @@ module Concurrent
160
162
  set_deref_options(opts)
161
163
  @executor = opts[:executor]
162
164
 
163
- @task = block
164
- @state = :pending
165
- @computing = false
165
+ @task = block
166
+ @state = :pending
167
+ @evaluation_started = false
166
168
  end
167
169
 
168
170
  private
@@ -173,7 +175,7 @@ module Concurrent
173
175
  # should not be modified without running new benchmarks
174
176
  execute = task = nil
175
177
  synchronize do
176
- execute = @computing = true unless @computing
178
+ execute = @evaluation_started = true unless @evaluation_started
177
179
  task = @task
178
180
  end
179
181
 
@@ -8,7 +8,7 @@ require 'concurrent/utility/monotonic_time'
8
8
 
9
9
  module Concurrent
10
10
 
11
- # @!macro [attach] exchanger
11
+ # @!macro exchanger
12
12
  #
13
13
  # A synchronization point at which threads can pair and swap elements within
14
14
  # pairs. Each thread presents some object on entry to the exchange method,
@@ -24,9 +24,6 @@ module Concurrent
24
24
  # will remain correct.
25
25
  #
26
26
  # @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Exchanger.html java.util.concurrent.Exchanger
27
- #
28
- # @!macro edge_warning
29
- #
30
27
  # @example
31
28
  #
32
29
  # exchanger = Concurrent::Exchanger.new
@@ -36,20 +33,19 @@ module Concurrent
36
33
  # Thread.new { puts "second: " << exchanger.exchange('bar', 1) } #=> "second: foo"
37
34
  # ]
38
35
  # threads.each {|t| t.join(2) }
39
- #
36
+
40
37
  # @!visibility private
41
38
  class AbstractExchanger < Synchronization::Object
42
39
 
43
40
  # @!visibility private
44
- CANCEL = Object.new
41
+ CANCEL = ::Object.new
45
42
  private_constant :CANCEL
46
43
 
47
- # @!macro [attach] exchanger_method_initialize
48
44
  def initialize
49
45
  super
50
46
  end
51
47
 
52
- # @!macro [attach] exchanger_method_do_exchange
48
+ # @!macro exchanger_method_do_exchange
53
49
  #
54
50
  # Waits for another thread to arrive at this exchange point (unless the
55
51
  # current thread is interrupted), and then transfers the given object to
@@ -61,7 +57,7 @@ module Concurrent
61
57
  # @param [Object] value the value to exchange with another thread
62
58
  # @param [Numeric, nil] timeout in seconds, `nil` blocks indefinitely
63
59
  #
64
- # @!macro [attach] exchanger_method_exchange
60
+ # @!macro exchanger_method_exchange
65
61
  #
66
62
  # In some edge cases when a `timeout` is given a return value of `nil` may be
67
63
  # ambiguous. Specifically, if `nil` is a valid value in the exchange it will
@@ -75,8 +71,7 @@ module Concurrent
75
71
  end
76
72
 
77
73
  # @!macro exchanger_method_do_exchange
78
- #
79
- # @!macro [attach] exchanger_method_exchange_bang
74
+ # @!macro exchanger_method_exchange_bang
80
75
  #
81
76
  # On timeout a {Concurrent::TimeoutError} exception will be raised.
82
77
  #
@@ -91,8 +86,7 @@ module Concurrent
91
86
  end
92
87
 
93
88
  # @!macro exchanger_method_do_exchange
94
- #
95
- # @!macro [attach] exchanger_method_try_exchange
89
+ # @!macro exchanger_method_try_exchange
96
90
  #
97
91
  # The return value will be a {Concurrent::Maybe} set to `Just` on success or
98
92
  # `Nothing` on timeout.
@@ -130,7 +124,6 @@ module Concurrent
130
124
  end
131
125
  end
132
126
 
133
- # @!macro exchanger
134
127
  # @!macro internal_implementation_note
135
128
  # @!visibility private
136
129
  class RubyExchanger < AbstractExchanger
@@ -163,7 +156,6 @@ module Concurrent
163
156
  end
164
157
  private_constant :Node
165
158
 
166
- # @!macro exchanger_method_initialize
167
159
  def initialize
168
160
  super
169
161
  end
@@ -218,7 +210,7 @@ module Concurrent
218
210
  # node's initial value. It never changes. It's what the fulfiller returns on
219
211
  # success. The occupier's hole is where the fulfiller put its item. It's the
220
212
  # item that the occupier returns on success. The latch is used for synchronization.
221
- # Becuase a thread may act as either an occupier or fulfiller (or possibly
213
+ # Because a thread may act as either an occupier or fulfiller (or possibly
222
214
  # both in periods of high contention) every thread creates a node when
223
215
  # the exchange method is first called.
224
216
  #
@@ -298,12 +290,10 @@ module Concurrent
298
290
 
299
291
  if Concurrent.on_jruby?
300
292
 
301
- # @!macro exchanger
302
293
  # @!macro internal_implementation_note
303
294
  # @!visibility private
304
295
  class JavaExchanger < AbstractExchanger
305
296
 
306
- # @!macro exchanger_method_initialize
307
297
  def initialize
308
298
  @exchanger = java.util.concurrent.Exchanger.new
309
299
  end
@@ -315,9 +305,11 @@ module Concurrent
315
305
  # @return [Object, CANCEL] the value exchanged by the other thread; {CANCEL} on timeout
316
306
  def do_exchange(value, timeout)
317
307
  if timeout.nil?
318
- @exchanger.exchange(value)
308
+ Synchronization::JRuby.sleep_interruptibly { @exchanger.exchange(value) }
319
309
  else
320
- @exchanger.exchange(value, 1000 * timeout, java.util.concurrent.TimeUnit::MILLISECONDS)
310
+ Synchronization::JRuby.sleep_interruptibly do
311
+ @exchanger.exchange(value, 1000 * timeout, java.util.concurrent.TimeUnit::MILLISECONDS)
312
+ end
321
313
  end
322
314
  rescue java.util.concurrent.TimeoutException
323
315
  CANCEL
@@ -339,7 +331,7 @@ module Concurrent
339
331
  class Exchanger < ExchangerImplementation
340
332
 
341
333
  # @!method initialize
342
- # @!macro exchanger_method_initialize
334
+ # Creates exchanger instance
343
335
 
344
336
  # @!method exchange(value, timeout = nil)
345
337
  # @!macro exchanger_method_do_exchange
@@ -93,7 +93,7 @@ module Concurrent
93
93
  raise NotImplementedError
94
94
  end
95
95
 
96
- # @!macro [attach] executor_service_method_ns_shutdown_execution
96
+ # @!macro executor_service_method_ns_shutdown_execution
97
97
  #
98
98
  # Callback method called when an orderly shutdown has completed.
99
99
  # The default behavior is to signal all waiting threads.
@@ -101,7 +101,7 @@ module Concurrent
101
101
  # do nothing
102
102
  end
103
103
 
104
- # @!macro [attach] executor_service_method_ns_kill_execution
104
+ # @!macro executor_service_method_ns_kill_execution
105
105
  #
106
106
  # Callback method called when the executor has been killed.
107
107
  # The default behavior is to do nothing.
@@ -26,7 +26,7 @@ module Concurrent
26
26
  # @!macro thread_pool_options
27
27
  class CachedThreadPool < ThreadPoolExecutor
28
28
 
29
- # @!macro [attach] cached_thread_pool_method_initialize
29
+ # @!macro cached_thread_pool_method_initialize
30
30
  #
31
31
  # Create a new thread pool.
32
32
  #
@@ -4,7 +4,7 @@ module Concurrent
4
4
 
5
5
  ###################################################################
6
6
 
7
- # @!macro [new] executor_service_method_post
7
+ # @!macro executor_service_method_post
8
8
  #
9
9
  # Submit a task to the executor for asynchronous processing.
10
10
  #
@@ -17,7 +17,7 @@ module Concurrent
17
17
  #
18
18
  # @raise [ArgumentError] if no task is given
19
19
 
20
- # @!macro [new] executor_service_method_left_shift
20
+ # @!macro executor_service_method_left_shift
21
21
  #
22
22
  # Submit a task to the executor for asynchronous processing.
23
23
  #
@@ -25,13 +25,13 @@ module Concurrent
25
25
  #
26
26
  # @return [self] returns itself
27
27
 
28
- # @!macro [new] executor_service_method_can_overflow_question
28
+ # @!macro executor_service_method_can_overflow_question
29
29
  #
30
30
  # Does the task queue have a maximum size?
31
31
  #
32
32
  # @return [Boolean] True if the task queue has a maximum size else false.
33
33
 
34
- # @!macro [new] executor_service_method_serialized_question
34
+ # @!macro executor_service_method_serialized_question
35
35
  #
36
36
  # Does this executor guarantee serialization of its operations?
37
37
  #
@@ -41,7 +41,7 @@ module Concurrent
41
41
 
42
42
  ###################################################################
43
43
 
44
- # @!macro [new] executor_service_public_api
44
+ # @!macro executor_service_public_api
45
45
  #
46
46
  # @!method post(*args, &task)
47
47
  # @!macro executor_service_method_post
@@ -57,23 +57,23 @@ module Concurrent
57
57
 
58
58
  ###################################################################
59
59
 
60
- # @!macro [new] executor_service_attr_reader_fallback_policy
60
+ # @!macro executor_service_attr_reader_fallback_policy
61
61
  # @return [Symbol] The fallback policy in effect. Either `:abort`, `:discard`, or `:caller_runs`.
62
62
 
63
- # @!macro [new] executor_service_method_shutdown
63
+ # @!macro executor_service_method_shutdown
64
64
  #
65
65
  # Begin an orderly shutdown. Tasks already in the queue will be executed,
66
66
  # but no new tasks will be accepted. Has no additional effect if the
67
67
  # thread pool is not running.
68
68
 
69
- # @!macro [new] executor_service_method_kill
69
+ # @!macro executor_service_method_kill
70
70
  #
71
71
  # Begin an immediate shutdown. In-progress tasks will be allowed to
72
72
  # complete but enqueued tasks will be dismissed and no new tasks
73
73
  # will be accepted. Has no additional effect if the thread pool is
74
74
  # not running.
75
75
 
76
- # @!macro [new] executor_service_method_wait_for_termination
76
+ # @!macro executor_service_method_wait_for_termination
77
77
  #
78
78
  # Block until executor shutdown is complete or until `timeout` seconds have
79
79
  # passed.
@@ -85,31 +85,31 @@ module Concurrent
85
85
  #
86
86
  # @return [Boolean] `true` if shutdown complete or false on `timeout`
87
87
 
88
- # @!macro [new] executor_service_method_running_question
88
+ # @!macro executor_service_method_running_question
89
89
  #
90
90
  # Is the executor running?
91
91
  #
92
92
  # @return [Boolean] `true` when running, `false` when shutting down or shutdown
93
93
 
94
- # @!macro [new] executor_service_method_shuttingdown_question
94
+ # @!macro executor_service_method_shuttingdown_question
95
95
  #
96
96
  # Is the executor shuttingdown?
97
97
  #
98
98
  # @return [Boolean] `true` when not running and not shutdown, else `false`
99
99
 
100
- # @!macro [new] executor_service_method_shutdown_question
100
+ # @!macro executor_service_method_shutdown_question
101
101
  #
102
102
  # Is the executor shutdown?
103
103
  #
104
104
  # @return [Boolean] `true` when shutdown, `false` when shutting down or running
105
105
 
106
- # @!macro [new] executor_service_method_auto_terminate_question
106
+ # @!macro executor_service_method_auto_terminate_question
107
107
  #
108
108
  # Is the executor auto-terminate when the application exits?
109
109
  #
110
110
  # @return [Boolean] `true` when auto-termination is enabled else `false`.
111
111
 
112
- # @!macro [new] executor_service_method_auto_terminate_setter
112
+ # @!macro executor_service_method_auto_terminate_setter
113
113
  #
114
114
  # Set the auto-terminate behavior for this executor.
115
115
  #
@@ -119,7 +119,7 @@ module Concurrent
119
119
 
120
120
  ###################################################################
121
121
 
122
- # @!macro [new] abstract_executor_service_public_api
122
+ # @!macro abstract_executor_service_public_api
123
123
  #
124
124
  # @!macro executor_service_public_api
125
125
  #
@@ -3,44 +3,44 @@ require 'concurrent/executor/thread_pool_executor'
3
3
 
4
4
  module Concurrent
5
5
 
6
- # @!macro [new] thread_pool_executor_constant_default_max_pool_size
6
+ # @!macro thread_pool_executor_constant_default_max_pool_size
7
7
  # Default maximum number of threads that will be created in the pool.
8
8
 
9
- # @!macro [new] thread_pool_executor_constant_default_min_pool_size
9
+ # @!macro thread_pool_executor_constant_default_min_pool_size
10
10
  # Default minimum number of threads that will be retained in the pool.
11
11
 
12
- # @!macro [new] thread_pool_executor_constant_default_max_queue_size
12
+ # @!macro thread_pool_executor_constant_default_max_queue_size
13
13
  # Default maximum number of tasks that may be added to the task queue.
14
14
 
15
- # @!macro [new] thread_pool_executor_constant_default_thread_timeout
15
+ # @!macro thread_pool_executor_constant_default_thread_timeout
16
16
  # Default maximum number of seconds a thread in the pool may remain idle
17
17
  # before being reclaimed.
18
18
 
19
- # @!macro [new] thread_pool_executor_attr_reader_max_length
19
+ # @!macro thread_pool_executor_attr_reader_max_length
20
20
  # The maximum number of threads that may be created in the pool.
21
21
  # @return [Integer] The maximum number of threads that may be created in the pool.
22
22
 
23
- # @!macro [new] thread_pool_executor_attr_reader_min_length
23
+ # @!macro thread_pool_executor_attr_reader_min_length
24
24
  # The minimum number of threads that may be retained in the pool.
25
25
  # @return [Integer] The minimum number of threads that may be retained in the pool.
26
26
 
27
- # @!macro [new] thread_pool_executor_attr_reader_largest_length
27
+ # @!macro thread_pool_executor_attr_reader_largest_length
28
28
  # The largest number of threads that have been created in the pool since construction.
29
29
  # @return [Integer] The largest number of threads that have been created in the pool since construction.
30
30
 
31
- # @!macro [new] thread_pool_executor_attr_reader_scheduled_task_count
31
+ # @!macro thread_pool_executor_attr_reader_scheduled_task_count
32
32
  # The number of tasks that have been scheduled for execution on the pool since construction.
33
33
  # @return [Integer] The number of tasks that have been scheduled for execution on the pool since construction.
34
34
 
35
- # @!macro [new] thread_pool_executor_attr_reader_completed_task_count
35
+ # @!macro thread_pool_executor_attr_reader_completed_task_count
36
36
  # The number of tasks that have been completed by the pool since construction.
37
37
  # @return [Integer] The number of tasks that have been completed by the pool since construction.
38
38
 
39
- # @!macro [new] thread_pool_executor_attr_reader_idletime
39
+ # @!macro thread_pool_executor_attr_reader_idletime
40
40
  # The number of seconds that a thread may be idle before being reclaimed.
41
41
  # @return [Integer] The number of seconds that a thread may be idle before being reclaimed.
42
42
 
43
- # @!macro [new] thread_pool_executor_attr_reader_max_queue
43
+ # @!macro thread_pool_executor_attr_reader_max_queue
44
44
  # The maximum number of tasks that may be waiting in the work queue at any one time.
45
45
  # When the queue size reaches `max_queue` subsequent tasks will be rejected in
46
46
  # accordance with the configured `fallback_policy`.
@@ -49,15 +49,15 @@ module Concurrent
49
49
  # When the queue size reaches `max_queue` subsequent tasks will be rejected in
50
50
  # accordance with the configured `fallback_policy`.
51
51
 
52
- # @!macro [new] thread_pool_executor_attr_reader_length
52
+ # @!macro thread_pool_executor_attr_reader_length
53
53
  # The number of threads currently in the pool.
54
54
  # @return [Integer] The number of threads currently in the pool.
55
55
 
56
- # @!macro [new] thread_pool_executor_attr_reader_queue_length
56
+ # @!macro thread_pool_executor_attr_reader_queue_length
57
57
  # The number of tasks in the queue awaiting execution.
58
58
  # @return [Integer] The number of tasks in the queue awaiting execution.
59
59
 
60
- # @!macro [new] thread_pool_executor_attr_reader_remaining_capacity
60
+ # @!macro thread_pool_executor_attr_reader_remaining_capacity
61
61
  # Number of tasks that may be enqueued before reaching `max_queue` and rejecting
62
62
  # new tasks. A value of -1 indicates that the queue may grow without bound.
63
63
  #
@@ -68,7 +68,7 @@ module Concurrent
68
68
 
69
69
 
70
70
 
71
- # @!macro [new] thread_pool_executor_public_api
71
+ # @!macro thread_pool_executor_public_api
72
72
  #
73
73
  # @!macro abstract_executor_service_public_api
74
74
  #
@@ -108,7 +108,7 @@ module Concurrent
108
108
 
109
109
 
110
110
 
111
- # @!macro [new] thread_pool_options
111
+ # @!macro thread_pool_options
112
112
  #
113
113
  # **Thread Pool Options**
114
114
  #
@@ -169,7 +169,7 @@ module Concurrent
169
169
 
170
170
 
171
171
 
172
- # @!macro [attach] fixed_thread_pool
172
+ # @!macro fixed_thread_pool
173
173
  #
174
174
  # A thread pool that reuses a fixed number of threads operating off an unbounded queue.
175
175
  # At any point, at most `num_threads` will be active processing tasks. When all threads are busy new
@@ -182,7 +182,7 @@ module Concurrent
182
182
  # @!macro thread_pool_options
183
183
  class FixedThreadPool < ThreadPoolExecutor
184
184
 
185
- # @!macro [attach] fixed_thread_pool_method_initialize
185
+ # @!macro fixed_thread_pool_method_initialize
186
186
  #
187
187
  # Create a new thread pool.
188
188
  #