parallel 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/parallel.rb +3 -2
- data/parallel.gemspec +20 -20
- metadata +22 -22
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.4
|
data/lib/parallel.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'thread' # to get Thread.exclusive
|
2
2
|
require 'base64'
|
3
|
+
require 'rbconfig'
|
3
4
|
|
4
5
|
class Parallel
|
5
6
|
VERSION = File.read( File.join(File.dirname(__FILE__),'..','VERSION') ).strip
|
@@ -60,10 +61,10 @@ class Parallel
|
|
60
61
|
end
|
61
62
|
|
62
63
|
def self.processor_count
|
63
|
-
case
|
64
|
+
case RbConfig::CONFIG['host_os']
|
64
65
|
when /darwin9/
|
65
66
|
`hwprefs cpu_count`.to_i
|
66
|
-
when /
|
67
|
+
when /darwin/
|
67
68
|
(hwprefs_available? ? `hwprefs thread_count` : `sysctl -n hw.ncpu`).to_i
|
68
69
|
when /linux/
|
69
70
|
`cat /proc/cpuinfo | grep processor | wc -l`.to_i
|
data/parallel.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{parallel}
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael Grosser"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-06-02}
|
13
13
|
s.email = %q{grosser.michael@gmail.com}
|
14
14
|
s.files = [
|
15
15
|
"Gemfile",
|
@@ -46,32 +46,32 @@ Gem::Specification.new do |s|
|
|
46
46
|
s.homepage = %q{http://github.com/grosser/parallel}
|
47
47
|
s.rdoc_options = ["--charset=UTF-8"]
|
48
48
|
s.require_paths = ["lib"]
|
49
|
-
s.rubygems_version = %q{1.
|
49
|
+
s.rubygems_version = %q{1.6.2}
|
50
50
|
s.summary = %q{Run any kind of code in parallel processes}
|
51
51
|
s.test_files = [
|
52
|
-
"spec/
|
53
|
-
"spec/
|
54
|
-
"spec/cases/
|
55
|
-
"spec/cases/map_with_processes_and_exceptions.rb",
|
52
|
+
"spec/cases/parallel_map_uneven.rb",
|
53
|
+
"spec/cases/parallel_raise.rb",
|
54
|
+
"spec/cases/parallel_influence_outside_data.rb",
|
56
55
|
"spec/cases/no_dump_with_each.rb",
|
57
|
-
"spec/cases/parallel_high_fork_rate.rb",
|
58
|
-
"spec/cases/map_with_index.rb",
|
59
|
-
"spec/cases/parallel_with_set_processes.rb",
|
60
56
|
"spec/cases/parallel_map.rb",
|
57
|
+
"spec/cases/map_with_index_empty.rb",
|
58
|
+
"spec/cases/parallel_with_nil_uses_detected_cpus.rb",
|
61
59
|
"spec/cases/map_with_threads_and_exceptions.rb",
|
62
|
-
"spec/cases/parallel_influence_outside_data.rb",
|
63
|
-
"spec/cases/parallel_start_and_kill.rb",
|
64
|
-
"spec/cases/parallel_map_uneven.rb",
|
65
|
-
"spec/cases/parallel_map_sleeping.rb",
|
66
|
-
"spec/cases/parallel_with_detected_cpus.rb",
|
67
60
|
"spec/cases/closes_processes_at_runtime.rb",
|
61
|
+
"spec/cases/parallel_high_fork_rate.rb",
|
62
|
+
"spec/cases/map_with_processes_and_exceptions.rb",
|
63
|
+
"spec/cases/parallel_map_range.rb",
|
64
|
+
"spec/cases/parallel_map_sleeping.rb",
|
65
|
+
"spec/cases/parallel_start_and_kill.rb",
|
68
66
|
"spec/cases/each.rb",
|
69
|
-
"spec/cases/map_with_nested_arrays_and_nil.rb",
|
70
|
-
"spec/cases/map_with_index_empty.rb",
|
71
|
-
"spec/cases/parallel_raise.rb",
|
72
67
|
"spec/cases/each_with_index.rb",
|
73
|
-
"spec/cases/
|
74
|
-
"spec/cases/
|
68
|
+
"spec/cases/map_with_index.rb",
|
69
|
+
"spec/cases/parallel_with_detected_cpus.rb",
|
70
|
+
"spec/cases/parallel_sleeping_2.rb",
|
71
|
+
"spec/cases/parallel_with_set_processes.rb",
|
72
|
+
"spec/cases/map_with_nested_arrays_and_nil.rb",
|
73
|
+
"spec/parallel_spec.rb",
|
74
|
+
"spec/spec_helper.rb"
|
75
75
|
]
|
76
76
|
|
77
77
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 4
|
10
|
+
version: 0.5.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Grosser
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-06-02 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -88,31 +88,31 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
requirements: []
|
89
89
|
|
90
90
|
rubyforge_project:
|
91
|
-
rubygems_version: 1.
|
91
|
+
rubygems_version: 1.6.2
|
92
92
|
signing_key:
|
93
93
|
specification_version: 3
|
94
94
|
summary: Run any kind of code in parallel processes
|
95
95
|
test_files:
|
96
|
-
- spec/
|
97
|
-
- spec/
|
98
|
-
- spec/cases/
|
99
|
-
- spec/cases/map_with_processes_and_exceptions.rb
|
96
|
+
- spec/cases/parallel_map_uneven.rb
|
97
|
+
- spec/cases/parallel_raise.rb
|
98
|
+
- spec/cases/parallel_influence_outside_data.rb
|
100
99
|
- spec/cases/no_dump_with_each.rb
|
101
|
-
- spec/cases/parallel_high_fork_rate.rb
|
102
|
-
- spec/cases/map_with_index.rb
|
103
|
-
- spec/cases/parallel_with_set_processes.rb
|
104
100
|
- spec/cases/parallel_map.rb
|
101
|
+
- spec/cases/map_with_index_empty.rb
|
102
|
+
- spec/cases/parallel_with_nil_uses_detected_cpus.rb
|
105
103
|
- spec/cases/map_with_threads_and_exceptions.rb
|
106
|
-
- spec/cases/parallel_influence_outside_data.rb
|
107
|
-
- spec/cases/parallel_start_and_kill.rb
|
108
|
-
- spec/cases/parallel_map_uneven.rb
|
109
|
-
- spec/cases/parallel_map_sleeping.rb
|
110
|
-
- spec/cases/parallel_with_detected_cpus.rb
|
111
104
|
- spec/cases/closes_processes_at_runtime.rb
|
105
|
+
- spec/cases/parallel_high_fork_rate.rb
|
106
|
+
- spec/cases/map_with_processes_and_exceptions.rb
|
107
|
+
- spec/cases/parallel_map_range.rb
|
108
|
+
- spec/cases/parallel_map_sleeping.rb
|
109
|
+
- spec/cases/parallel_start_and_kill.rb
|
112
110
|
- spec/cases/each.rb
|
113
|
-
- spec/cases/map_with_nested_arrays_and_nil.rb
|
114
|
-
- spec/cases/map_with_index_empty.rb
|
115
|
-
- spec/cases/parallel_raise.rb
|
116
111
|
- spec/cases/each_with_index.rb
|
117
|
-
- spec/cases/
|
118
|
-
- spec/cases/
|
112
|
+
- spec/cases/map_with_index.rb
|
113
|
+
- spec/cases/parallel_with_detected_cpus.rb
|
114
|
+
- spec/cases/parallel_sleeping_2.rb
|
115
|
+
- spec/cases/parallel_with_set_processes.rb
|
116
|
+
- spec/cases/map_with_nested_arrays_and_nil.rb
|
117
|
+
- spec/parallel_spec.rb
|
118
|
+
- spec/spec_helper.rb
|