Skip to content

Commit 5364788

Browse files
committed
Released v1.0.1
1 parent 0f292ec commit 5364788

File tree

7 files changed

+92
-11
lines changed

7 files changed

+92
-11
lines changed

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
## Current Release v1.0.0 (13 November 2015)
1+
## Current Release v1.0.1 (27 February 2016)
2+
3+
* Fix "uninitialized constant Concurrent::ReentrantReadWriteLock" error.
4+
* Better handling of `autoload` vs. `require`.
5+
* Improved API for Edge `Future` zipping.
6+
* Fix reference leak in Edge `Future` constructor .
7+
* Fix bug which prevented thread pools from surviving a `fork`.
8+
* Fix bug in which `TimerTask` did not correctly specify all its dependencies.
9+
* Improved support for JRuby+Truffle
10+
* Improved error messages.
11+
* Improved documentation.
12+
* Updated README and CONTRIBUTING.
13+
14+
### Release v1.0.0 (13 November 2015)
215

316
* Rename `attr_volatile_with_cas` to `attr_atomic`
417
* Add `clear_each` to `LockFreeStack`

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ Implement your feature or bug fix.
5050

5151
Make sure that `bundle exec rake` completes without errors.
5252

53+
#### Follow the Guidelines
54+
55+
There are a few very strong guidelines which we follow when adding features. Submissions which fail to follow these guidelines will likely be rejected or will require modification before acceptance.
56+
57+
* **No downstream dependencies:** Concurrent Ruby is a foundational library used by major projects like [Rails](http://rubyonrails.org/). Our downstream dependencies become everyone's dependencies. Because we cannot guarantee that downstream projects meet our development standards, it's best for everyone if we simply aviod dependencies.
58+
* **Do not monkey patch Ruby:** Changing Ruby for our convenience affects every gem in every project that uses Concurrent Ruby. Monkey patching Ruby may change the behavior of other libraries in unexpected ways and destabilize projects which depend on us.
59+
* **Do not polute the global namespace:** Putting all our code within the `Concurrent` module guarantees that there will be no namespace collisions with other gems or the projects which depend on us.
60+
* **No global varaibles:** Global state should be kept to an absolute minimum. When it's necessary, add it to the global gem configuration.
61+
* **Minimize per-object configuration:** Ruby makes programmers happy. One of Ruby's charms is its simplicity. Concurrent Ruby aims to mirror this simplicity. Advanced configuration options are encouraged when they provide value, but every abstraction should have reasonable defaults that meet the needs of most users.
62+
* **Provide explicit behavior and guarantees:** Our APIs should be concrete and clearly define what they do (and don't do). Users of Concurrent Ruby should never be surprised by unexpected behavior or be given guarantees we cannot keep.
63+
* **Eat our own dog food:** Concurrent Ruby provides a rich set of low-level (internal and public) classes which provide strong guarantees and are optimized for performance across platforms. All our high-level abstractions should make use of these tools.
64+
5365
#### Write Documentation
5466

5567
Document any external behavior in the [README](README.md).

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545

4646
### Supported Ruby versions
4747

48-
MRI 1.9.3, 2.0, 2.1, 2.2, JRuby (1.9 mode), and Rubinius 2.x are supported.
48+
MRI 1.9.3, 2.0 and above, JRuby 1.7x in 1.9 mode, JRuby 9000, and Rubinius 2.x are supported.
4949
This gem should be fully compatible with any interpreter that is compliant with Ruby 1.9.3 or newer.
50-
Java 8 is preferred for JRuby but every Java version on which JRuby 9000 runs will be supported.
50+
Java 8 is preferred for JRuby but every Java version on which JRuby 9000 runs is supported.
5151

5252
## Thread Safety
5353

@@ -59,14 +59,10 @@ It is critical to remember, however, that Ruby is a language of mutable referenc
5959

6060
## Features & Documentation
6161

62-
We have a roadmap guiding our work toward the [v1.0.0 release](https://github.com/ruby-concurrency/concurrent-ruby/issues/257).
63-
6462
The primary site for documentation is the automatically generated [API documentation](http://ruby-concurrency.github.io/concurrent-ruby/frames.html)
6563

6664
We also have a [mailing list](http://groups.google.com/group/concurrent-ruby) and [IRC (gitter)](https://gitter.im/ruby-concurrency/concurrent-ruby).
6765

68-
This library contains a variety of concurrency abstractions at high and low levels. One of the high-level abstractions is likely to meet most common needs.
69-
7066
#### General-purpose Concurrency Abstractions
7167

7268
* [Async](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Async.html): A mixin module that provides simple asynchronous behavior to a class. Loosely based on Erlang's [gen_server](http://www.erlang.org/doc/man/gen_server.html).

Rakefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ Dir.glob('tasks/**/*.rake').each do |rakefile|
4242
end
4343

4444
def has_docker?
45-
system("docker version > /dev/null 2>&1 || boot2docker version > /dev/null 2>&1")
45+
if Concurrent.on_linux?
46+
system("docker version > /dev/null 2>&1")
47+
elsif Concurrent.on_osx?
48+
system("docker version > /dev/null 2>&1 || boot2docker version > /dev/null 2>&1")
49+
else
50+
false
51+
end
4652
end
4753

4854
if Concurrent.on_jruby?

lib/concurrent/map.rb

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,43 @@ module Collection
4141
# > require 'concurrent'
4242
# >
4343
# > map = Concurrent::Map.new
44-
4544
class Map < Collection::MapImplementation
45+
46+
# @!macro [new] map_method_is_atomic
47+
# This method is atomic. Atomic methods of `Map` which accept a block
48+
# do not allow the `self` instance to be used within the block. Doing
49+
# so will cause a deadlock.
50+
51+
# @!method put_if_absent
52+
# @!macro map_method_is_atomic
53+
54+
# @!method compute_if_absent
55+
# @!macro map_method_is_atomic
56+
57+
# @!method compute_if_present
58+
# @!macro map_method_is_atomic
59+
60+
# @!method compute
61+
# @!macro map_method_is_atomic
62+
63+
# @!method merge_pair
64+
# @!macro map_method_is_atomic
65+
66+
# @!method replace_pair
67+
# @!macro map_method_is_atomic
68+
69+
# @!method replace_if_exists
70+
# @!macro map_method_is_atomic
71+
72+
# @!method get_and_set
73+
# @!macro map_method_is_atomic
74+
75+
# @!method delete
76+
# @!macro map_method_is_atomic
77+
78+
# @!method delete_pair
79+
# @!macro map_method_is_atomic
80+
4681
def initialize(options = nil, &block)
4782
if options.kind_of?(::Hash)
4883
validate_options_hash!(options)
@@ -71,6 +106,15 @@ def [](key)
71106
alias_method :get, :[]
72107
alias_method :put, :[]=
73108

109+
# @!macro [attach] map_method_not_atomic
110+
# The "fetch-then-act" methods of `Map` are not atomic. `Map` is intended
111+
# to be use as a concurrency primitive with strong happens-before
112+
# guarantees. It is not intended to be used as a high-level abstraction
113+
# supporting complex operations. All read and write operations are
114+
# thread safe, but no guarantees are made regarding race conditions
115+
# between the fetch operation and yielding to the block. Additionally,
116+
# this method does not support recursion. This is due to internal
117+
# constraints that are very unlikely to change in the near future.
74118
def fetch(key, default_value = NULL)
75119
if NULL != (value = get_or_default(key, NULL))
76120
value
@@ -83,12 +127,14 @@ def fetch(key, default_value = NULL)
83127
end
84128
end
85129

130+
# @!macro map_method_not_atomic
86131
def fetch_or_store(key, default_value = NULL)
87132
fetch(key) do
88133
put(key, block_given? ? yield(key) : (NULL == default_value ? raise_fetch_no_key : default_value))
89134
end
90135
end
91136

137+
# @!macro map_method_is_atomic
92138
def put_if_absent(key, value)
93139
computed = false
94140
result = compute_if_absent(key) do

lib/concurrent/utility/engine.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ def on_windows?
2727
!(RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/).nil?
2828
end
2929

30+
def on_osx?
31+
!(RbConfig::CONFIG['host_os'] =~ /darwin|mac os/).nil?
32+
end
33+
34+
def on_linux?
35+
!(RbConfig::CONFIG['host_os'] =~ /linux/).nil?
36+
end
37+
3038
def ruby_engine
3139
defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
3240
end

lib/concurrent/version.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module Concurrent
2-
VERSION = '1.0.0'
3-
EDGE_VERSION = '0.2.0'
2+
VERSION = '1.0.1'
3+
EDGE_VERSION = '0.2.1'
44
end

0 commit comments

Comments
 (0)