public
Description: brain-dead simple parallel processing for ruby
Homepage:
Clone URL: git://github.com/ahoward/forkoff.git
ahoward (author)
Mon Oct 12 09:34:40 -0700 2009
commit  7671b5abf108e8107304b16f80b8395b088ffdff
tree    959cc80c0bfdcaa6c3665cfe3d78f4bdcabb4167
parent  b63f58a16dd3c12b13177af1e1c51af05278322e
forkoff / readme.erb
100644 77 lines (48 sloc) 1.936 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
NAME
 
  forkoff
 
SYNOPSIS
 
  brain-dead simple parallel processing for ruby
 
URI
 
  http://rubyforge.org/projects/codeforpeople
  http://github.com/ahoward/forkoff
 
INSTALL
 
  gem install forkoff
 
DESCRIPTION
 
  forkoff works for any enumerable object, iterating a code block to run in a
  child process and collecting the results. forkoff can limit the number of
  child processes which is, by default, 2.
 
SAMPLES
 
  <%= samples %>
 
HISTORY
  1.1.0
    - move to a model with one work queue and signals sent from consumers to
    producer to noitify ready state. this let's smaller jobs race through a
    single process even while a larger job may have one sub-process bound up.
    incorporates a fix from http://github.com/fredrikj/forkoff which meant
    some processes would lag behind when jobs didn't have similar execution
    times.
 
  1.0.0
    - move to github
 
  0.0.4
    - code re-org
    - add :strategy option
    - default number of processes is 2, not 8
 
  0.0.1
 
    - updated to use producer threds pushing onto a SizedQueue for each consumer
      channel. in this way the producers do not build up a massize parllel data
      structure but provide data to the consumers only as fast as they can fork
      and proccess it. basically for a 4 process run you'll end up with 4
      channels of size 1 between 4 produces and 4 consumers, each consumer is a
      thread popping of jobs, forking, and yielding results.
 
    - removed use of Queue for capturing the output. now it's simply an array
      of arrays which removed some sync overhead.
 
    - you can configure the number of processes globally with
 
        Forkoff.default['proccess'] = 4
 
    - you can now pass either an options hash
 
        forkoff( :processes => 2 ) ...
 
      or plain vanilla number
 
        forkoff( 2 ) ...
 
      to the forkoff call
 
    - default number of processes is 8, not 2
        
 
  0.0.0
 
    initial version