concurrent-ruby 1.1.9 → 1.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/Gemfile +2 -7
  4. data/README.md +17 -21
  5. data/Rakefile +2 -12
  6. data/ext/concurrent-ruby/com/concurrent_ruby/ext/JavaAtomicFixnumLibrary.java +0 -0
  7. data/ext/concurrent-ruby/com/concurrent_ruby/ext/JavaSemaphoreLibrary.java +52 -22
  8. data/lib/concurrent-ruby/concurrent/async.rb +1 -0
  9. data/lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb +1 -0
  10. data/lib/concurrent-ruby/concurrent/atomic/event.rb +2 -2
  11. data/lib/concurrent-ruby/concurrent/atomic/mutex_semaphore.rb +18 -2
  12. data/lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb +4 -6
  13. data/lib/concurrent-ruby/concurrent/atomic/semaphore.rb +26 -5
  14. data/lib/concurrent-ruby/concurrent/concurrent_ruby.jar +0 -0
  15. data/lib/concurrent-ruby/concurrent/executor/abstract_executor_service.rb +16 -13
  16. data/lib/concurrent-ruby/concurrent/executor/fixed_thread_pool.rb +13 -3
  17. data/lib/concurrent-ruby/concurrent/executor/java_executor_service.rb +1 -1
  18. data/lib/concurrent-ruby/concurrent/executor/java_thread_pool_executor.rb +4 -0
  19. data/lib/concurrent-ruby/concurrent/executor/ruby_executor_service.rb +10 -4
  20. data/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb +26 -37
  21. data/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb +5 -5
  22. data/lib/concurrent-ruby/concurrent/map.rb +0 -1
  23. data/lib/concurrent-ruby/concurrent/scheduled_task.rb +29 -16
  24. data/lib/concurrent-ruby/concurrent/synchronization/lockable_object.rb +1 -3
  25. data/lib/concurrent-ruby/concurrent/timer_task.rb +11 -33
  26. data/lib/concurrent-ruby/concurrent/tvar.rb +20 -60
  27. data/lib/concurrent-ruby/concurrent/utility/monotonic_time.rb +67 -35
  28. data/lib/concurrent-ruby/concurrent/utility/processor_counter.rb +2 -35
  29. data/lib/concurrent-ruby/concurrent/version.rb +1 -1
  30. data/lib/concurrent-ruby/concurrent-ruby.rb +5 -1
  31. metadata +7 -7
@@ -79,47 +79,14 @@ module Concurrent
79
79
  def compute_processor_count
80
80
  if Concurrent.on_jruby?
81
81
  java.lang.Runtime.getRuntime.availableProcessors
82
- elsif Etc.respond_to?(:nprocessors) && (nprocessor = Etc.nprocessors rescue nil)
83
- nprocessor
84
82
  else
85
- os_name = RbConfig::CONFIG["target_os"]
86
- if os_name =~ /mingw|mswin/
87
- require 'win32ole'
88
- result = WIN32OLE.connect("winmgmts://").ExecQuery(
89
- "select NumberOfLogicalProcessors from Win32_Processor")
90
- result.to_enum.collect(&:NumberOfLogicalProcessors).reduce(:+)
91
- elsif File.readable?("/proc/cpuinfo") && (cpuinfo_count = IO.read("/proc/cpuinfo").scan(/^processor/).size) > 0
92
- cpuinfo_count
93
- elsif File.executable?("/usr/bin/nproc")
94
- IO.popen("/usr/bin/nproc --all", &:read).to_i
95
- elsif File.executable?("/usr/bin/hwprefs")
96
- IO.popen("/usr/bin/hwprefs thread_count", &:read).to_i
97
- elsif File.executable?("/usr/sbin/psrinfo")
98
- IO.popen("/usr/sbin/psrinfo", &:read).scan(/^.*on-*line/).size
99
- elsif File.executable?("/usr/sbin/ioscan")
100
- IO.popen("/usr/sbin/ioscan -kC processor", &:read).scan(/^.*processor/).size
101
- elsif File.executable?("/usr/sbin/pmcycles")
102
- IO.popen("/usr/sbin/pmcycles -m", &:read).count("\n")
103
- elsif File.executable?("/usr/sbin/lsdev")
104
- IO.popen("/usr/sbin/lsdev -Cc processor -S 1", &:read).count("\n")
105
- elsif File.executable?("/usr/sbin/sysconf") and os_name =~ /irix/i
106
- IO.popen("/usr/sbin/sysconf NPROC_ONLN", &:read).to_i
107
- elsif File.executable?("/usr/sbin/sysctl")
108
- IO.popen("/usr/sbin/sysctl -n hw.ncpu", &:read).to_i
109
- elsif File.executable?("/sbin/sysctl")
110
- IO.popen("/sbin/sysctl -n hw.ncpu", &:read).to_i
111
- else
112
- # TODO (pitr-ch 05-Nov-2016): warn about failures
113
- 1
114
- end
83
+ Etc.nprocessors
115
84
  end
116
- rescue
117
- return 1
118
85
  end
119
86
 
120
87
  def compute_physical_processor_count
121
88
  ppc = case RbConfig::CONFIG["target_os"]
122
- when /darwin1/
89
+ when /darwin\d\d/
123
90
  IO.popen("/usr/sbin/sysctl -n hw.physicalcpu", &:read).to_i
124
91
  when /linux/
125
92
  cores = {} # unique physical ID / core ID combinations
@@ -1,3 +1,3 @@
1
1
  module Concurrent
2
- VERSION = '1.1.9'
2
+ VERSION = '1.1.10'
3
3
  end
@@ -1 +1,5 @@
1
- require_relative "./concurrent"
1
+ # This file is here so that there is a file with the same name as the gem that
2
+ # can be required by Bundler.require. Applications should normally
3
+ # require 'concurrent'.
4
+
5
+ require_relative "concurrent"
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.1.9
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: 2021-06-05 00:00:00.000000000 Z
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.
@@ -170,7 +170,7 @@ licenses:
170
170
  metadata:
171
171
  source_code_uri: https://github.com/ruby-concurrency/concurrent-ruby
172
172
  changelog_uri: https://github.com/ruby-concurrency/concurrent-ruby/blob/master/CHANGELOG.md
173
- post_install_message:
173
+ post_install_message:
174
174
  rdoc_options: []
175
175
  require_paths:
176
176
  - lib/concurrent-ruby
@@ -178,15 +178,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
178
178
  requirements:
179
179
  - - ">="
180
180
  - !ruby/object:Gem::Version
181
- version: 1.9.3
181
+ version: '2.2'
182
182
  required_rubygems_version: !ruby/object:Gem::Requirement
183
183
  requirements:
184
184
  - - ">="
185
185
  - !ruby/object:Gem::Version
186
186
  version: '0'
187
187
  requirements: []
188
- rubygems_version: 3.2.3
189
- signing_key:
188
+ rubygems_version: 3.3.4
189
+ signing_key:
190
190
  specification_version: 4
191
191
  summary: Modern concurrency tools for Ruby. Inspired by Erlang, Clojure, Scala, Haskell,
192
192
  F#, C#, Java, and classic concurrency patterns.