concurrent-ruby-ext 0.1.0.pre1-x64-mingw32 → 0.8.0.pre2-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.md +1 -0
- data/README.md +47 -12
- data/ext/{concurrent_ruby_ext → concurrent}/atomic_boolean.c +0 -0
- data/ext/{concurrent_ruby_ext → concurrent}/atomic_boolean.h +0 -0
- data/ext/{concurrent_ruby_ext → concurrent}/atomic_fixnum.c +0 -0
- data/ext/{concurrent_ruby_ext → concurrent}/atomic_fixnum.h +0 -0
- data/ext/{concurrent_ruby_ext → concurrent}/atomic_reference.c +0 -0
- data/ext/{concurrent_ruby_ext → concurrent}/atomic_reference.h +0 -0
- data/ext/{concurrent_ruby_ext → concurrent}/extconf.rb +3 -4
- data/ext/{concurrent_ruby_ext → concurrent}/rb_concurrent.c +2 -2
- data/ext/{concurrent_ruby_ext → concurrent}/ruby_193_compatible.h +0 -0
- data/lib/{2.0/concurrent_ruby_ext.so → concurrent/2.0/extension.so} +0 -0
- data/lib/extension_helper.rb +37 -0
- metadata +18 -17
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTIwYjNhMGQ0MjQ2ZjY1YTRmOGU2NGM5M2U2NTQ2YTBkM2YxMzFiYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NWNlOTlhODQyZTM3ZDVhOTgyZmZhMjJlYzMxOTU5ZDQ4ZDhhZTE2Mg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Yjc4YTNhZTU4NmJjMmFkMjgyODAzYzg5YmM4MWJhNzZmZTEwMzUwZDEyOTQ1
|
10
|
+
NzM1Mzg0N2YyY2U3NWI0YjAwZmQ5YzIwY2Y4MDc1N2Y3OTVlMTBhZTE0M2Iw
|
11
|
+
NDVjNzhmOWQyN2Q3ZmFiZDg2NTc4ZWMzZDhjODhhNDM2NzUzMzU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTY4MWZjNWVkM2YwM2I1NTA3OTY1Y2E1MzI5N2E0Y2YxNDc1Mzc0M2VhZDRh
|
14
|
+
MzYxOTNiNzBhMWY2OWNhZTlhMjZjNDAzODhiOTJlNGY1MDNhMTM4OWZmYzRl
|
15
|
+
YzdhNzQ1MTJiNDg5YmNlYjVjYWJmYWVkMTk1NzNkODExYTYxYjE=
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
### Next Release v0.7.2 (TBD)
|
2
2
|
|
3
|
+
* New `Semaphore` class based on [java.util.concurrent.Semaphore](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Semaphore.html)
|
3
4
|
* New `Promise.all?` and `Promise.any?` class methods
|
4
5
|
* Renamed `:overflow_policy` on thread pools to `:fallback_policy`
|
5
6
|
* Thread pools still accept the `:overflow_policy` option but display a warning
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@
|
|
37
37
|
|
38
38
|
### Supported Ruby versions
|
39
39
|
|
40
|
-
MRI 1.9.3, 2.0, 2.1, JRuby (1.9 mode), and Rubinius 2.x are supported.
|
40
|
+
MRI 1.9.3, 2.0, 2.1, 2.2, JRuby (1.9 mode), and Rubinius 2.x are supported.
|
41
41
|
This gem should be fully compatible with any interpreter that is compliant with Ruby 1.9.3 or newer.
|
42
42
|
|
43
43
|
## Features & Documentation
|
@@ -52,19 +52,19 @@ This library contains a variety of concurrency abstractions at high and low leve
|
|
52
52
|
|
53
53
|
### High-level, general-purpose asynchronous concurrency abstractions
|
54
54
|
|
55
|
-
* [Actor](
|
56
|
-
* [Agent](
|
57
|
-
* [Async](
|
58
|
-
* [Future](
|
59
|
-
* [Dataflow](
|
60
|
-
* [Promise](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Promise.html): Similar to Futures, with more features.
|
61
|
-
* [ScheduledTask](
|
55
|
+
* [Actor](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Actor.html): Implements the Actor Model, where concurrent actors exchange messages.
|
56
|
+
* [Agent](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Agent.html): A single atomic value that represents an identity.
|
57
|
+
* [Async](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Async.html): A mixin module that provides simple asynchronous behavior to any standard class/object or object.
|
58
|
+
* [Future](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Future.html): An asynchronous operation that produces a value.
|
59
|
+
* [Dataflow](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Dataflow.html): Built on Futures, Dataflow allows you to create a task that will be scheduled when all of its data dependencies are available.
|
60
|
+
* [Promise](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Promise.html): Similar to Futures, with more features.
|
61
|
+
* [ScheduledTask](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/ScheduledTask.html): Like a Future scheduled for a specific future time.
|
62
62
|
* [TimerTask](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/TimerTask.html): A Thread that periodically wakes up to perform work at regular intervals.
|
63
63
|
* [Channel](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Channel.html): Communicating Sequential Processes (CSP).
|
64
64
|
|
65
65
|
### Java-inspired ThreadPools and other executors
|
66
66
|
|
67
|
-
* See [ThreadPool](
|
67
|
+
* See [ThreadPool](http://ruby-concurrency.github.io/concurrent-ruby/file.thread_pools.html) overview, which also contains a list of other Executors available.
|
68
68
|
|
69
69
|
### Thread-safe Observers
|
70
70
|
|
@@ -73,6 +73,7 @@ This library contains a variety of concurrency abstractions at high and low leve
|
|
73
73
|
* [CopyOnWriteObserverSet](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/CopyOnWriteObserverSet.html)
|
74
74
|
|
75
75
|
### Thread synchronization classes and algorithms
|
76
|
+
|
76
77
|
Lower-level abstractions mainly used as building blocks.
|
77
78
|
|
78
79
|
* [condition](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Condition.html)
|
@@ -80,10 +81,12 @@ Lower-level abstractions mainly used as building blocks.
|
|
80
81
|
* [cyclic barrier](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/CyclicBarrier.html)
|
81
82
|
* [event](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Event.html)
|
82
83
|
* [exchanger](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Exchanger.html)
|
84
|
+
* [semaphore](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Semaphore.html)
|
83
85
|
* [timeout](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent.html#timeout-class_method)
|
84
86
|
* [timer](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent.html#timer-class_method)
|
85
87
|
|
86
88
|
### Thread-safe variables
|
89
|
+
|
87
90
|
Lower-level abstractions mainly used as building blocks.
|
88
91
|
|
89
92
|
* [AtomicBoolean](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/AtomicBoolean.html)
|
@@ -92,7 +95,7 @@ Lower-level abstractions mainly used as building blocks.
|
|
92
95
|
* [I-Structures](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/IVar.html) (IVar)
|
93
96
|
* [M-Structures](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/MVar.html) (MVar)
|
94
97
|
* [thread-local variables](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/ThreadLocalVar.html)
|
95
|
-
* [software transactional memory](
|
98
|
+
* [software transactional memory](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/TVar.html) (TVar)
|
96
99
|
|
97
100
|
## Usage
|
98
101
|
|
@@ -153,7 +156,7 @@ To minimize installation errors the C extensions are available in the `concurren
|
|
153
156
|
gem. The extension gem lists `concurrent-ruby` as a dependency so it is not necessary to install both.
|
154
157
|
Simply install the extension gen:
|
155
158
|
|
156
|
-
```
|
159
|
+
```ruby
|
157
160
|
gem install concurrent-ruby-ext
|
158
161
|
```
|
159
162
|
|
@@ -167,13 +170,45 @@ and run `bundle install` from your shell.
|
|
167
170
|
|
168
171
|
In code it is only necessary to
|
169
172
|
|
170
|
-
```
|
173
|
+
```ruby
|
171
174
|
require 'concurrent'
|
172
175
|
```
|
173
176
|
|
174
177
|
The `concurrent-ruby` gem will automatically detect the presence of the `concurrent-ruby-ext` gem
|
175
178
|
and load the appropriate C extensions.
|
176
179
|
|
180
|
+
#### Note For gem developers
|
181
|
+
|
182
|
+
No gems should depend on `concurrent-ruby-ext`. Doing so will force C extensions on your users.
|
183
|
+
The best practice is to depend on `concurrent-ruby` and let users to decide if they want C extensions.
|
184
|
+
|
185
|
+
### Building
|
186
|
+
|
187
|
+
All published versions of this gem (core, extension, and several platform-specific packages) are compiled,
|
188
|
+
packaged, tested, and published using an open, [automated process](https://github.com/ruby-concurrency/rake-compiler-dev-box).
|
189
|
+
This process can also be used to create pre-compiled binaries of the extension gem for virtally
|
190
|
+
any platform. *Documentation is forthcoming...*
|
191
|
+
|
192
|
+
```
|
193
|
+
*MRI only*
|
194
|
+
rake build:native # Build concurrent-ruby-ext-<version>-<platform>.gem into the pkg directory
|
195
|
+
rake compile:extension # Compile extension
|
196
|
+
|
197
|
+
*JRuby only*
|
198
|
+
rake build # Build JRuby-specific core gem (alias for `build:core`)
|
199
|
+
rake build:core # Build concurrent-ruby-<version>-java.gem into the pkg directory
|
200
|
+
|
201
|
+
*All except JRuby*
|
202
|
+
rake build # Build core and extension gems
|
203
|
+
rake build:core # Build concurrent-ruby-<version>.gem into the pkg directory
|
204
|
+
rake build:ext # Build concurrent-ruby-ext-<version>.gem into the pkg directory
|
205
|
+
|
206
|
+
*All*
|
207
|
+
rake clean # Remove any temporary products
|
208
|
+
rake clobber # Remove any generated file
|
209
|
+
rake compile # Compile all the extensions
|
210
|
+
```
|
211
|
+
|
177
212
|
## Maintainers
|
178
213
|
|
179
214
|
* [Jerry D'Antonio](https://github.com/jdantonio)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,9 +1,8 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
|
3
|
-
|
4
|
-
require 'extension_helper'
|
3
|
+
require_relative '../../lib/extension_helper'
|
5
4
|
|
6
|
-
EXTENSION_NAME = '
|
5
|
+
EXTENSION_NAME = 'extension'
|
7
6
|
|
8
7
|
def create_dummy_makefile
|
9
8
|
File.open('Makefile', 'w') do |f|
|
@@ -50,7 +49,7 @@ else
|
|
50
49
|
}
|
51
50
|
CODE
|
52
51
|
|
53
|
-
create_makefile(EXTENSION_NAME)
|
52
|
+
create_makefile('concurrent/' + EXTENSION_NAME)
|
54
53
|
rescue
|
55
54
|
create_dummy_makefile
|
56
55
|
warn 'C optimizations cannot be compiled on this version of Ruby.'
|
@@ -11,9 +11,9 @@ static VALUE rb_cAtomic;
|
|
11
11
|
static VALUE rb_cAtomicBoolean;
|
12
12
|
static VALUE rb_cAtomicFixnum;
|
13
13
|
|
14
|
-
//
|
14
|
+
// Init_extension
|
15
15
|
|
16
|
-
void
|
16
|
+
void Init_extension() {
|
17
17
|
|
18
18
|
// define modules and classes
|
19
19
|
rb_mConcurrent = rb_define_module("Concurrent");
|
File without changes
|
Binary file
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Concurrent
|
2
|
+
|
3
|
+
@@c_ext_loaded ||= false
|
4
|
+
@@java_ext_loaded ||= false
|
5
|
+
|
6
|
+
# @!visibility private
|
7
|
+
def self.allow_c_extensions?
|
8
|
+
defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ruby'
|
9
|
+
end
|
10
|
+
|
11
|
+
# @!visibility private
|
12
|
+
def self.jruby?
|
13
|
+
RUBY_PLATFORM == 'java'
|
14
|
+
end
|
15
|
+
|
16
|
+
if allow_c_extensions? && !@@c_ext_loaded
|
17
|
+
begin
|
18
|
+
require 'concurrent/extension'
|
19
|
+
@@c_ext_loaded = true
|
20
|
+
rescue LoadError
|
21
|
+
# may be a Windows cross-compiled native gem
|
22
|
+
begin
|
23
|
+
require "#{RUBY_VERSION[0..2]}/concurrent/extension"
|
24
|
+
@@c_ext_loaded = true
|
25
|
+
rescue LoadError
|
26
|
+
warn 'Performance on MRI may be improved with the concurrent-ruby-ext gem. Please see http://concurrent-ruby.com'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
elsif jruby? && !@@java_ext_loaded
|
30
|
+
begin
|
31
|
+
require 'concurrent_ruby_ext'
|
32
|
+
@@java_ext_loaded = true
|
33
|
+
rescue LoadError
|
34
|
+
warn 'Attempted to load Java extensions on unsupported platform. Continuing with pure-Ruby.'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: concurrent-ruby-ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0.pre2
|
5
5
|
platform: x64-mingw32
|
6
6
|
authors:
|
7
7
|
- Jerry D'Antonio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -16,17 +16,16 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.8.0.
|
19
|
+
version: 0.8.0.pre2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.8.0.
|
27
|
-
description: ! "
|
28
|
-
|
29
|
-
JavaScript, actors, and classic concurrency patterns.\n"
|
26
|
+
version: 0.8.0.pre2
|
27
|
+
description: ! " C extensions to optimize the concurrent-ruby gem when running
|
28
|
+
under MRI.\n Please see http://concurrent-ruby.com for more information.\n"
|
30
29
|
email: jerry.dantonio@gmail.com
|
31
30
|
executables: []
|
32
31
|
extensions: []
|
@@ -38,19 +37,20 @@ files:
|
|
38
37
|
- CHANGELOG.md
|
39
38
|
- LICENSE.txt
|
40
39
|
- README.md
|
41
|
-
- ext/
|
42
|
-
- ext/
|
43
|
-
- ext/
|
44
|
-
- ext/
|
45
|
-
- ext/
|
46
|
-
- ext/
|
47
|
-
- ext/
|
48
|
-
- ext/
|
49
|
-
- ext/
|
50
|
-
- lib/2.0/
|
40
|
+
- ext/concurrent/atomic_boolean.c
|
41
|
+
- ext/concurrent/atomic_boolean.h
|
42
|
+
- ext/concurrent/atomic_fixnum.c
|
43
|
+
- ext/concurrent/atomic_fixnum.h
|
44
|
+
- ext/concurrent/atomic_reference.c
|
45
|
+
- ext/concurrent/atomic_reference.h
|
46
|
+
- ext/concurrent/extconf.rb
|
47
|
+
- ext/concurrent/rb_concurrent.c
|
48
|
+
- ext/concurrent/ruby_193_compatible.h
|
49
|
+
- lib/concurrent/2.0/extension.so
|
51
50
|
- lib/concurrent/atomic_reference/concurrent_update_error.rb
|
52
51
|
- lib/concurrent/atomic_reference/direct_update.rb
|
53
52
|
- lib/concurrent/atomic_reference/numeric_cas_wrapper.rb
|
53
|
+
- lib/extension_helper.rb
|
54
54
|
homepage: http://www.concurrent-ruby.com
|
55
55
|
licenses:
|
56
56
|
- MIT
|
@@ -59,6 +59,7 @@ post_install_message:
|
|
59
59
|
rdoc_options: []
|
60
60
|
require_paths:
|
61
61
|
- lib
|
62
|
+
- ext
|
62
63
|
required_ruby_version: !ruby/object:Gem::Requirement
|
63
64
|
requirements:
|
64
65
|
- - ! '>='
|