concurrent-ruby-ext 0.1.0.pre1-x86-mingw32 → 0.8.0.pre2-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDkyZGNhOGQxOGM0MGE0M2JiMzM5NTEyMGNlZTFlYjQyMDZjNTM3NA==
4
+ YzJiY2IxMzYxZDg0NTcwM2M3Y2NmMTQyNjUxMzkyYTYzNGNkOTY0NQ==
5
5
  data.tar.gz: !binary |-
6
- ZGYwNzA3NGIyMTY5YTdjNGJiYmU5NWMyNTVmNjE0MjE3ZWRjYTIyYw==
6
+ YzRkYWU3NjBkNzliNjU1OTViNzQ2NDA3YTFmMTg1NzVkMTJkOTUyYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTlkNTk4MmI0ZThmMmVhNzIxZTY4YzNmMTA2NWE5ODA4ZjBkMDExMzBlNDJj
10
- Mzc4YTM2ZDBjNTQ3OTg3NTg4MzQ5MGFkZTBmMjRhNTg2ODcxNzc4ZTE0Zjdm
11
- YjIwNTRjZDQwMWIxYTllOGNmNGYwZjZkOWEyMGJjMjdlNzlmZGY=
9
+ YjhkMWEyMWQ1MGE2ZjQ0YWUyMTcxM2E1YjQ5MmZhNzg4ZjQyNTFjMDBlZmZj
10
+ YzlhYjkzMDc0ZDg1MTg1YzY5MDY0YmU1MTlhZTE1ZGMxMGY2MDc4ZDgzMGZk
11
+ ZGRkYzM5OTM0ZGU5NTViYjZjN2UxMjA1NjQyZmUxZmQ1YTZjZjY=
12
12
  data.tar.gz: !binary |-
13
- YzVlMWEyN2MxY2E3NmRhNGJhYWE0MjkxNDY3NDk0NDY5MjE3ZGZlYjZkZmEw
14
- ZGUzZWVjNmE4OGNkNmI1YThkZDZjMDVkMmRiZGExNmM5MzI4YjIwMjE2Zjcz
15
- Yjg3Y2MwYWIwZWY4NDJlZDMxNzc4YTE2ZWY5MjVkNzRhYzg4ODY=
13
+ MjVjZTE3OTRiNWNkYTQ0ZmU2MWE4MGNmMDRhMGQ4NzYwYTExMzk4YmZiMTdl
14
+ MzIyMWU4NjkyN2U4NzU1MmE4ZWY1ZjhkYjVkNTc0OTE3MDc5ZTNkOWY5YWMy
15
+ YmM4ZTJjOTllYjRiOGVmMWU3MDIyZTg4NzhmMWViMjZiYjMxNTQ=
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](./doc/actor/main.md): Implements the Actor Model, where concurrent actors exchange messages.
56
- * [Agent](./doc/agent.md): A single atomic value that represents an identity.
57
- * [Async](./doc/async.md): A mixin module that provides simple asynchronous behavior to any standard class/object or object.
58
- * [Future](./doc/future.md): An asynchronous operation that produces a value.
59
- * [Dataflow](./doc/dataflow.md): 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](./doc/scheduled_task.md): Like a Future scheduled for a specific future time.
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](./doc/thread_pools.md) overview, which also contains a list of other Executors available.
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](./doc/tvar.md) (TVar)
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
- ```shell
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
- ```shell
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)
@@ -1,9 +1,8 @@
1
1
  require 'fileutils'
2
2
 
3
- $:.push File.join(File.dirname(__FILE__), '../../lib')
4
- require 'extension_helper'
3
+ require_relative '../../lib/extension_helper'
5
4
 
6
- EXTENSION_NAME = 'concurrent_ruby_ext'
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
- // Init_concurrent_ruby_ext
14
+ // Init_extension
15
15
 
16
- void Init_concurrent_ruby_ext() {
16
+ void Init_extension() {
17
17
 
18
18
  // define modules and classes
19
19
  rb_mConcurrent = rb_define_module("Concurrent");
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.1.0.pre1
4
+ version: 0.8.0.pre2
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Jerry D'Antonio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-15 00:00:00.000000000 Z
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.pre1
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.pre1
27
- description: ! " Modern concurrency tools including agents, futures, promises,
28
- thread pools, actors, supervisors, and more.\n Inspired by Erlang, Clojure, Go,
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,20 +37,21 @@ files:
38
37
  - CHANGELOG.md
39
38
  - LICENSE.txt
40
39
  - README.md
41
- - ext/concurrent_ruby_ext/atomic_boolean.c
42
- - ext/concurrent_ruby_ext/atomic_boolean.h
43
- - ext/concurrent_ruby_ext/atomic_fixnum.c
44
- - ext/concurrent_ruby_ext/atomic_fixnum.h
45
- - ext/concurrent_ruby_ext/atomic_reference.c
46
- - ext/concurrent_ruby_ext/atomic_reference.h
47
- - ext/concurrent_ruby_ext/extconf.rb
48
- - ext/concurrent_ruby_ext/rb_concurrent.c
49
- - ext/concurrent_ruby_ext/ruby_193_compatible.h
50
- - lib/1.9/concurrent_ruby_ext.so
51
- - lib/2.0/concurrent_ruby_ext.so
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/1.9/extension.so
50
+ - lib/concurrent/2.0/extension.so
52
51
  - lib/concurrent/atomic_reference/concurrent_update_error.rb
53
52
  - lib/concurrent/atomic_reference/direct_update.rb
54
53
  - lib/concurrent/atomic_reference/numeric_cas_wrapper.rb
54
+ - lib/extension_helper.rb
55
55
  homepage: http://www.concurrent-ruby.com
56
56
  licenses:
57
57
  - MIT
@@ -60,6 +60,7 @@ post_install_message:
60
60
  rdoc_options: []
61
61
  require_paths:
62
62
  - lib
63
+ - ext
63
64
  required_ruby_version: !ruby/object:Gem::Requirement
64
65
  requirements:
65
66
  - - ! '>='
Binary file