miner_mover 0.1.2.1 → 0.1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +20 -19
- data/VERSION +1 -1
- data/miner_mover.gemspec +9 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4901bb324083ef4c73adb1ed174794d0c90821fe9eae11f7a9935690dab821e3
|
4
|
+
data.tar.gz: ad001e368e39ab5e11bc2750d37e6aee4ba6dc42be2e08d0f346f57065c12a88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22db270f2c03cbbcace66a2724ed8c98315b14caa3d0d135e02e04d98b9baaaa49c9b2bc3aaa7f64b35fd6d5416611e29d344582dbc3cc5820ce351ea0a6b22c
|
7
|
+
data.tar.gz: 7ef93f90a90e33c34e3a5412495a828fb9030ccb160389b764448bf5e7e9dfe022687b1db9ba6e64e7418af541a681033d437b21ff50ebba320b18fa4a9c6095
|
data/README.md
CHANGED
@@ -42,33 +42,36 @@ configured via `:work_type`
|
|
42
42
|
|
43
43
|
# Usage
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
You'll want to use **Ruby 3.x** (CRuby) to make the most of Fibers.
|
48
|
-
|
49
|
-
### Dependencies
|
45
|
+
You'll want to use **Ruby 3.1+** (CRuby) to make the most of Ractors, Fibers,
|
46
|
+
and Fiber::Scheduler.
|
50
47
|
|
51
|
-
|
48
|
+
This gem can be used on JRuby and TruffleRuby, but several concurrency options
|
49
|
+
are not available: process forking, Ractors, and Fiber::Scheduler.
|
50
|
+
However, their threading performance exceeds CRuby's as they don't have a
|
51
|
+
Global VM Lock (GVL).
|
52
52
|
|
53
|
-
|
53
|
+
## Install
|
54
54
|
|
55
|
-
|
55
|
+
Right now, a gem installation only provides the Miner Mover library.
|
56
|
+
Use the **Development** process below to access all of the demonstration
|
57
|
+
scripts showing the different concurrency strategies.
|
56
58
|
|
57
|
-
|
59
|
+
`gem install miner_mover`
|
58
60
|
|
59
|
-
|
60
|
-
* io-event
|
61
|
+
For Ruby 3.1+ on linux, you'll also want:
|
61
62
|
|
62
63
|
`gem install fiber_scheduler io-event`
|
63
64
|
|
64
|
-
|
65
|
+
## Development
|
65
66
|
|
66
67
|
```
|
67
68
|
git clone https://github.com/rickhull/miner_mover
|
68
69
|
cd miner_mover
|
70
|
+
bundle config set --local with development
|
71
|
+
bundle install
|
69
72
|
```
|
70
73
|
|
71
|
-
###
|
74
|
+
### Rake Tasks
|
72
75
|
|
73
76
|
Try: `rake -T` to see available [Rake tasks](Rakefile)
|
74
77
|
|
@@ -90,8 +93,6 @@ rake thread # Run demo/thread.rb
|
|
90
93
|
|
91
94
|
Try: `rake test`
|
92
95
|
|
93
|
-
## Rake Tasks
|
94
|
-
|
95
96
|
Included demonstration scripts can be executed via Rake tasks.
|
96
97
|
The following order is recommended:
|
97
98
|
|
@@ -106,7 +107,7 @@ The following order is recommended:
|
|
106
107
|
Try each task; there will be about 6 seconds worth of many lines of output
|
107
108
|
logging. These rake tasks correspond to the scripts within [`demo/`](demo/).
|
108
109
|
|
109
|
-
|
110
|
+
### Satisfy `LOAD_PATH`
|
110
111
|
|
111
112
|
Rake tasks take care of `LOAD_PATH`, so the following is
|
112
113
|
**only necessary when *not* using rake tasks**:
|
@@ -116,7 +117,7 @@ Rake tasks take care of `LOAD_PATH`, so the following is
|
|
116
117
|
`require 'miner_mover'` will work.
|
117
118
|
* This project does not use `require_relative`
|
118
119
|
|
119
|
-
|
120
|
+
### Exploration in `irb`
|
120
121
|
|
121
122
|
`$ irb -I lib`
|
122
123
|
|
@@ -190,7 +191,7 @@ irb(main):010:0> mover.state
|
|
190
191
|
:ore_moved=>0}
|
191
192
|
```
|
192
193
|
|
193
|
-
|
194
|
+
### Included scripts
|
194
195
|
|
195
196
|
These scripts implement a full miner mover simulation using different
|
196
197
|
multitasking paradigms in Ruby.
|
@@ -210,7 +211,7 @@ multiple miners or movers.
|
|
210
211
|
|
211
212
|
Execute via e.g. `ruby -Ilib demo/thread.rb`
|
212
213
|
|
213
|
-
###
|
214
|
+
### Concurrency Strategies
|
214
215
|
|
215
216
|
#### [Serial](demo/serial.rb)
|
216
217
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.2.
|
1
|
+
0.1.2.3
|
data/miner_mover.gemspec
CHANGED
@@ -13,10 +13,15 @@ EOF
|
|
13
13
|
|
14
14
|
s.version = File.read(File.join(__dir__, 'VERSION')).chomp
|
15
15
|
|
16
|
-
s.files =
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
s.files = Dir[
|
17
|
+
'miner_mover.gemspec',
|
18
|
+
'VERSION',
|
19
|
+
'README.md',
|
20
|
+
'Rakefile',
|
21
|
+
'lib/**/*.rb',
|
22
|
+
'test/**/*.rb',
|
23
|
+
'demo/**/*.rb',
|
24
|
+
]
|
20
25
|
|
21
26
|
s.add_runtime_dependency "dotcfg", "~> 1.0"
|
22
27
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miner_mover
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.2.
|
4
|
+
version: 0.1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rick Hull
|
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '0'
|
74
74
|
requirements: []
|
75
|
-
rubygems_version: 3.4.
|
75
|
+
rubygems_version: 3.4.1
|
76
76
|
signing_key:
|
77
77
|
specification_version: 4
|
78
78
|
summary: This project provides a basic concurrency problem useful for exploring different
|