Skip to content

Commit 54c4d2a

Browse files
committed
Updated README with information regarding concurrent-ruby-ext
1 parent 77422e0 commit 54c4d2a

File tree

1 file changed

+56
-41
lines changed

1 file changed

+56
-41
lines changed

README.md

Lines changed: 56 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@
3838
### Supported Ruby versions
3939

4040
MRI 1.9.3, 2.0, 2.1, JRuby (1.9 mode), and Rubinius 2.x are supported.
41-
Although native code is used for performance optimizations on some platforms, all functionality
42-
is available in pure Ruby. This gem should be fully compatible with any interpreter that is
43-
compliant with Ruby 1.9.3 or newer.
41+
This gem should be fully compatible with any interpreter that is compliant with Ruby 1.9.3 or newer.
4442

4543
## Features & Documentation
4644

@@ -59,10 +57,10 @@ This library contains a variety of concurrency abstractions at high and low leve
5957
* [Async](./doc/async.md): A mixin module that provides simple asynchronous behavior to any standard class/object or object.
6058
* [Future](./doc/future.md): An asynchronous operation that produces a value.
6159
* [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.
62-
* [Promise](./doc/promise.md): Similar to Futures, with more features.
60+
* [Promise](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Promise.html): Similar to Futures, with more features.
6361
* [ScheduledTask](./doc/scheduled_task.md): Like a Future scheduled for a specific future time.
6462
* [TimerTask](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/TimerTask.html): A Thread that periodically wakes up to perform work at regular intervals.
65-
63+
* [Channel](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Channel.html): Communicating Sequential Processes (CSP).
6664

6765
### Java-inspired ThreadPools and other executors
6866

@@ -96,30 +94,45 @@ Lower-level abstractions mainly used as building blocks.
9694
* [thread-local variables](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/ThreadLocalVar.html)
9795
* [software transactional memory](./doc/tvar.md) (TVar)
9896

97+
## Usage
9998

99+
All abstractions within this gem can be loaded simply by requiring it:
100100

101-
## Installing and Building
102-
103-
This gem includes several platform-specific optimizations. To reduce the possibility of
104-
compilation errors, we provide pre-compiled gem packages for several platforms as well
105-
as a pure-Ruby build. Installing the gem should be no different than installing any other
106-
Rubygems-hosted gem. Rubygems will automatically detect your platform and install the
107-
appropriate pre-compiled build. You should never see Rubygems attempt to compile the gem
108-
on installation. Additionally, to ensure compatability with the largest possible number
109-
of Ruby interpreters, the C extensions will *never* load under any Ruby other than MRI,
110-
even when installed.
101+
```ruby
102+
require 'concurrent'
103+
```
111104

112-
The following gem builds will be built at every release:
105+
To reduce the amount of code loaded at runtime, subsets of this gem can be required:
113106

114-
* concurrent-ruby-x.y.z.gem (pure Ruby)
115-
* concurrent-ruby-x.y.z-java.gem (JRuby)
116-
* concurrent-ruby-x.y.z-x86-linux.gem (Linux 32-bit)
117-
* concurrent-ruby-x.y.z-x86_64-linux.gem (Linux 64-bit)
118-
* concurrent-ruby-x.y.z-x86-mingw32.gem (Windows 32-bit)
119-
* concurrent-ruby-x.y.z-x64-mingw32.gem (Windows 64-bit)
120-
* concurrent-ruby-x.y.z-x86-solaris-2.11.gem (Solaris)
107+
```ruby
108+
require 'concurrent' # everything
109+
110+
# groups
111+
112+
require 'concurrent/actor' # Concurrent::Actor and supporting code
113+
require 'concurrent/atomics' # atomic and thread synchronization classes
114+
require 'concurrent/channels' # Concurrent::Channel and supporting code
115+
require 'concurrent/executors' # Thread pools and other executors
116+
require 'concurrent/utilities' # utility methods such as processor count and timers
117+
118+
# individual abstractions
119+
120+
require 'concurrent/agent' # Concurrent::Agent
121+
require 'concurrent/async' # Concurrent::Async
122+
require 'concurrent/atomic' # Concurrent::Atomic (formerly the `atomic` gem)
123+
require 'concurrent/dataflow' # Concurrent::dataflow
124+
require 'concurrent/delay' # Concurrent::Delay
125+
require 'concurrent/exchanger' # Concurrent::Exchanger
126+
require 'concurrent/future' # Concurrent::Future
127+
require 'concurrent/ivar' # Concurrent::IVar
128+
require 'concurrent/mvar' # Concurrent::MVar
129+
require 'concurrent/promise' # Concurrent::Promise
130+
require 'concurrent/scheduled_task' # Concurrent::ScheduledTask
131+
require 'concurrent/timer_task' # Concurrent::TimerTask
132+
require 'concurrent/tvar' # Concurrent::TVar
133+
```
121134

122-
### Installing
135+
## Installation
123136

124137
```shell
125138
gem install concurrent-ruby
@@ -133,40 +146,42 @@ gem 'concurrent-ruby'
133146

134147
and run `bundle install` from your shell.
135148

136-
### Building
149+
### C Extensions for MRI
137150

138-
Because we provide pre-compiled gem builds, users should never need to build the gem manually.
139-
The build process for this gem is completely automated using open source tools. All of
140-
the automation components are available in the [ruby-concurrency/rake-compiler-dev-box](https://github.com/ruby-concurrency/rake-compiler-dev-box)
141-
GitHub repository.
151+
Potential performance improvements may be achieved under MRI by installing optional C extensions.
152+
To minimize installation errors the C extensions are available in the `concurrent-ruby-ext` extension
153+
gem. The extension gem lists `concurrent-ruby` as a dependency so it is not necessary to install both.
154+
Simply install the extension gen:
142155

143-
This gem will compile native C code under MRI and native Java code under JRuby. It is
144-
also possible to build a pure-Ruby version. All builds have identical functionality.
145-
The only difference is performance. Additionally, pure-Ruby classes are always available,
146-
even when using the native optimizations. Please see the [documentation](http://ruby-concurrency.github.io/concurrent-ruby/)
147-
for more details.
156+
```shell
157+
gem install concurrent-ruby-ext
158+
```
148159

149-
To build and package the gem using MRI or JRuby, install the necessary build dependencies and run:
160+
or add the following line to Gemfile:
150161

151-
```shell
152-
bundle exec rake compile
153-
bundle exec rake build
162+
```ruby
163+
gem 'concurrent-ruby-ext'
154164
```
155165

156-
To build and package a pure-Ruby gem, on *any* platform and interpreter
157-
(including MRI and JRuby), run:
166+
and run `bundle install` from your shell.
167+
168+
In code it is only necessary to
158169

159170
```shell
160-
BUILD_PURE_RUBY='true' bundle exec rake build
171+
require 'concurrent'
161172
```
162173

174+
The `concurrent-ruby` gem will automatically detect the presence of the `concurrent-ruby-ext` gem
175+
and load the appropriate C extensions.
176+
163177
## Maintainers
164178

165179
* [Jerry D'Antonio](https://github.com/jdantonio)
166180
* [Michele Della Torre](https://github.com/mighe)
167181
* [Chris Seaton](https://github.com/chrisseaton)
168182
* [Lucas Allan](https://github.com/lucasallan)
169183
* [Petr Chalupa](https://github.com/pitr-ch)
184+
* [Paweł Obrok](https://github.com/obrok)
170185

171186
### Contributing
172187

0 commit comments

Comments
 (0)