-
Notifications
You must be signed in to change notification settings - Fork 5
/
readme.erb
76 lines (48 loc) · 1.89 KB
/
readme.erb
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
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