Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ group :development do
end

group :testing do
gem 'concurrent-ruby-ext', :platforms => :mri, git: 'https://github.com/ruby-concurrency/concurrent-ruby-ext', branch: 'master'
gem 'rspec', '~> 3.0.0'
gem 'simplecov', '~> 0.8.2', :require => false
gem 'coveralls', '~> 0.7.0', :require => false
Expand Down
62 changes: 17 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@
### Supported Ruby versions

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

## Features & Documentation

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



## Installing and Building

This gem includes several platform-specific optimizations. To reduce the possibility of
compilation errors, we provide pre-compiled gem packages for several platforms as well
as a pure-Ruby build. Installing the gem should be no different than installing any other
Rubygems-hosted gem. Rubygems will automatically detect your platform and install the
appropriate pre-compiled build. You should never see Rubygems attempt to compile the gem
on installation. Additionally, to ensure compatability with the largest possible number
of Ruby interpreters, the C extensions will *never* load under any Ruby other than MRI,
even when installed.

The following gem builds will be built at every release:

* concurrent-ruby-x.y.z.gem (pure Ruby)
* concurrent-ruby-x.y.z-java.gem (JRuby)
* concurrent-ruby-x.y.z-x86-linux.gem (Linux 32-bit)
* concurrent-ruby-x.y.z-x86_64-linux.gem (Linux 64-bit)
* concurrent-ruby-x.y.z-x86-mingw32.gem (Windows 32-bit)
* concurrent-ruby-x.y.z-x64-mingw32.gem (Windows 64-bit)
* concurrent-ruby-x.y.z-x86-solaris-2.11.gem (Solaris)

### Installing
## Installing

```shell
gem install concurrent-ruby
Expand All @@ -133,31 +108,28 @@ gem 'concurrent-ruby'

and run `bundle install` from your shell.

### Building
### Installing Optional C Extensions (MRI)

Because we provide pre-compiled gem builds, users should never need to build the gem manually.
The build process for this gem is completely automated using open source tools. All of
the automation components are available in the [ruby-concurrency/rake-compiler-dev-box](https://github.com/ruby-concurrency/rake-compiler-dev-box)
GitHub repository.
For improved performance on MRI a compantion gem with called `concurrent-ruby-ext` is provided. When the
extensions are installed `concurrent-ruby` will detect their presence and automatically load them.

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

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

```shell
bundle exec rake compile
bundle exec rake build
```ruby
gem 'concurrent-ruby'-ext
```

To build and package a pure-Ruby gem, on *any* platform and interpreter
(including MRI and JRuby), run:
and run `bundle install` from your shell.

```shell
BUILD_PURE_RUBY='true' bundle exec rake build
In your code make sure you require the extension gem **before** you require the core gem:

```ruby
require 'concurrent_ext'
require 'concurrent'
```

## Maintainers
Expand Down
27 changes: 0 additions & 27 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,6 @@ if defined?(JRUBY_VERSION)
ext.ext_dir = 'ext'
end

elsif Concurrent.allow_c_extensions?

Rake::ExtensionTask.new(EXTENSION_NAME, GEMSPEC) do |ext|
ext.ext_dir = "ext/#{EXTENSION_NAME}"
ext.cross_compile = true
ext.cross_platform = ['x86-mingw32', 'x64-mingw32']
end

ENV['RUBY_CC_VERSION'].to_s.split(':').each do |ruby_version|
platforms = {
'x86-mingw32' => 'i686-w64-mingw32',
'x64-mingw32' => 'x86_64-w64-mingw32'
}
platforms.each do |platform, prefix|
task "copy:#{EXTENSION_NAME}:#{platform}:#{ruby_version}" do |t|
%w[lib tmp/#{platform}/stage/lib].each do |dir|
so_file = "#{dir}/#{ruby_version[/^\d+\.\d+/]}/#{EXTENSION_NAME}.so"
if File.exists?(so_file)
sh "#{prefix}-strip -S #{so_file}"
end
end
end
end
end
else
task :clean
task :compile
Expand All @@ -67,10 +43,7 @@ end
Rake::Task[:clean].enhance do
rm_rf 'pkg/classes'
rm_rf 'tmp'
rm_rf 'lib/1.9'
rm_rf 'lib/2.0'
rm_f Dir.glob('./lib/*.jar')
rm_f Dir.glob('./**/*.bundle')
end

begin
Expand Down
9 changes: 2 additions & 7 deletions concurrent-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,9 @@ Gem::Specification.new do |s|
if defined?(JRUBY_VERSION)
s.files += Dir['lib/concurrent_ruby_ext.jar']
s.platform = 'java'
elsif ! ENV['BUILD_PURE_RUBY']
s.extensions = 'ext/concurrent_ruby_ext/extconf.rb'
s.files += Dir['ext/**/*.{h,c,cpp}']
else
s.add_dependency 'ref', '~> 1.0.5'
end

s.required_ruby_version = '>= 1.9.3'

unless defined?(JRUBY_VERSION)
s.add_dependency 'ref', '~> 1.0.5'
end
end
48 changes: 0 additions & 48 deletions ext/concurrent_ruby_ext/atomic_boolean.c

This file was deleted.

16 changes: 0 additions & 16 deletions ext/concurrent_ruby_ext/atomic_boolean.h

This file was deleted.

50 changes: 0 additions & 50 deletions ext/concurrent_ruby_ext/atomic_fixnum.c

This file was deleted.

13 changes: 0 additions & 13 deletions ext/concurrent_ruby_ext/atomic_fixnum.h

This file was deleted.

91 changes: 0 additions & 91 deletions ext/concurrent_ruby_ext/atomic_reference.c

This file was deleted.

Loading