parallel 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -25,7 +25,7 @@ Same can be done with `each`
25
25
  - Speedup through multiple CPUs
26
26
  - Speedup for blocking operations
27
27
  - Protects global data
28
- - Extra memory used
28
+ - Extra memory used ( very low on [REE](http://www.rubyenterpriseedition.com/faq.html) through `copy_on_write_friendly` )
29
29
  - Child processes are killed when your main process is killed through Ctrl+c or kill -2
30
30
 
31
31
  ### Threads
data/Rakefile CHANGED
@@ -1,12 +1,6 @@
1
- desc "Run all specs in spec directory"
2
- task :default do
3
- options = "--colour --format progress --loadby --reverse"
4
- files = FileList['spec/**/*_spec.rb']
5
- system("spec #{options} #{files}")
6
- end
7
-
8
- task :rdoc do
9
- end
1
+ task :default => :spec
2
+ require 'spec/rake/spectask'
3
+ Spec::Rake::SpecTask.new {|t| t.spec_opts = ['--color']}
10
4
 
11
5
  begin
12
6
  require 'jeweler'
@@ -17,16 +11,9 @@ begin
17
11
  gem.email = "grosser.michael@gmail.com"
18
12
  gem.homepage = "http://github.com/grosser/#{project_name}"
19
13
  gem.authors = ["Michael Grosser"]
20
- gem.rubyforge_project = 'parallel'
21
- end
22
-
23
- # fake task so that rubyforge:release works
24
- task :rdoc do
25
- `mkdir rdoc`
26
- `echo documentation is at http://github.com/grosser/#{project_name} > rdoc/README.rdoc`
27
14
  end
28
15
 
29
- Jeweler::RubyforgeTasks.new
16
+ Jeweler::GemcutterTasks.new
30
17
  rescue LoadError
31
18
  puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
32
19
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.5
1
+ 0.3.6
data/lib/parallel.rb CHANGED
@@ -24,6 +24,8 @@ class Parallel
24
24
  pids = []
25
25
  count.times do |i|
26
26
  reads[i], writes[i] = IO.pipe
27
+ # activate copy on write friendly GC of REE
28
+ GC.copy_on_write_friendly = true if GC.respond_to?(:copy_on_write_friendly=)
27
29
  pids << Process.fork do
28
30
  Marshal.dump(yield(i), writes[i]) # Serialize result
29
31
  end
data/parallel.gemspec CHANGED
@@ -1,15 +1,15 @@
1
1
  # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{parallel}
8
- s.version = "0.3.5"
8
+ s.version = "0.3.6"
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{2009-10-18}
12
+ s.date = %q{2009-11-22}
13
13
  s.email = %q{grosser.michael@gmail.com}
14
14
  s.extra_rdoc_files = [
15
15
  "README.markdown"
@@ -20,7 +20,6 @@ Gem::Specification.new do |s|
20
20
  "VERSION",
21
21
  "lib/parallel.rb",
22
22
  "parallel.gemspec",
23
- "rdoc/README.rdoc",
24
23
  "spec/cases/parallel_each.rb",
25
24
  "spec/cases/parallel_high_fork_rate.rb",
26
25
  "spec/cases/parallel_influence_outside_data.rb",
@@ -39,24 +38,23 @@ Gem::Specification.new do |s|
39
38
  s.homepage = %q{http://github.com/grosser/parallel}
40
39
  s.rdoc_options = ["--charset=UTF-8"]
41
40
  s.require_paths = ["lib"]
42
- s.rubyforge_project = %q{parallel}
43
41
  s.rubygems_version = %q{1.3.5}
44
42
  s.summary = %q{Run any kind of code in parallel processes}
45
43
  s.test_files = [
46
- "spec/parallel_spec.rb",
47
- "spec/spec_helper.rb",
44
+ "spec/spec_helper.rb",
45
+ "spec/cases/parallel_map_uneven.rb",
46
+ "spec/cases/parallel_map_range.rb",
47
+ "spec/cases/parallel_with_set_processes.rb",
48
+ "spec/cases/parallel_start_and_kill.rb",
48
49
  "spec/cases/parallel_raise.rb",
49
50
  "spec/cases/parallel_sleeping_2.rb",
50
- "spec/cases/parallel_high_fork_rate.rb",
51
- "spec/cases/parallel_start_and_kill.rb",
52
- "spec/cases/parallel_with_set_processes.rb",
51
+ "spec/cases/parallel_each.rb",
53
52
  "spec/cases/parallel_influence_outside_data.rb",
54
- "spec/cases/parallel_map_sleeping.rb",
55
- "spec/cases/parallel_map_uneven.rb",
56
- "spec/cases/parallel_map_range.rb",
57
- "spec/cases/parallel_with_detected_cpus.rb",
53
+ "spec/cases/parallel_high_fork_rate.rb",
58
54
  "spec/cases/parallel_map.rb",
59
- "spec/cases/parallel_each.rb"
55
+ "spec/cases/parallel_with_detected_cpus.rb",
56
+ "spec/cases/parallel_map_sleeping.rb",
57
+ "spec/parallel_spec.rb"
60
58
  ]
61
59
 
62
60
  if s.respond_to? :specification_version then
@@ -69,3 +67,4 @@ Gem::Specification.new do |s|
69
67
  else
70
68
  end
71
69
  end
70
+
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,2 @@
1
- # ---- requirements
2
- $LOAD_PATH << File.expand_path("../lib", File.dirname(__FILE__))
3
-
1
+ $LOAD_PATH << 'lib'
4
2
  require 'parallel'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-18 00:00:00 +02:00
12
+ date: 2009-11-22 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -27,7 +27,6 @@ files:
27
27
  - VERSION
28
28
  - lib/parallel.rb
29
29
  - parallel.gemspec
30
- - rdoc/README.rdoc
31
30
  - spec/cases/parallel_each.rb
32
31
  - spec/cases/parallel_high_fork_rate.rb
33
32
  - spec/cases/parallel_influence_outside_data.rb
@@ -65,23 +64,23 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
64
  version:
66
65
  requirements: []
67
66
 
68
- rubyforge_project: parallel
67
+ rubyforge_project:
69
68
  rubygems_version: 1.3.5
70
69
  signing_key:
71
70
  specification_version: 3
72
71
  summary: Run any kind of code in parallel processes
73
72
  test_files:
74
- - spec/parallel_spec.rb
75
73
  - spec/spec_helper.rb
74
+ - spec/cases/parallel_map_uneven.rb
75
+ - spec/cases/parallel_map_range.rb
76
+ - spec/cases/parallel_with_set_processes.rb
77
+ - spec/cases/parallel_start_and_kill.rb
76
78
  - spec/cases/parallel_raise.rb
77
79
  - spec/cases/parallel_sleeping_2.rb
78
- - spec/cases/parallel_high_fork_rate.rb
79
- - spec/cases/parallel_start_and_kill.rb
80
- - spec/cases/parallel_with_set_processes.rb
80
+ - spec/cases/parallel_each.rb
81
81
  - spec/cases/parallel_influence_outside_data.rb
82
- - spec/cases/parallel_map_sleeping.rb
83
- - spec/cases/parallel_map_uneven.rb
84
- - spec/cases/parallel_map_range.rb
85
- - spec/cases/parallel_with_detected_cpus.rb
82
+ - spec/cases/parallel_high_fork_rate.rb
86
83
  - spec/cases/parallel_map.rb
87
- - spec/cases/parallel_each.rb
84
+ - spec/cases/parallel_with_detected_cpus.rb
85
+ - spec/cases/parallel_map_sleeping.rb
86
+ - spec/parallel_spec.rb
data/rdoc/README.rdoc DELETED
@@ -1 +0,0 @@
1
- documentation is at http://github.com/grosser/parallel