Skip to content

Commit 37a3c30

Browse files
committed
Merge pull request #323 from ruby-concurrency/readme-changelog
Began updating README and CHANGELOG
2 parents 12d6aec + b97cfcf commit 37a3c30

File tree

3 files changed

+107
-32
lines changed

3 files changed

+107
-32
lines changed

CHANGELOG.md

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Next Release v0.9.0 (Target Date: 5 April 2015)
1+
### Next Release v0.9.0 (Target Date: 7 June 2015)
22

33
* Pure Java implementations of
44
- `AtomicBoolean`
@@ -20,7 +20,7 @@
2020
* Added `at_exit` handler to Ruby thread pools (already in Java thread pools)
2121
- Ruby handler stores the object id and retrieves from `ObjectSpace`
2222
- JRuby disables `ObjectSpace` by default so that handler stores the object reference
23-
* Added a `:stop_on_exit` option to thread pools to enable/disable `at_exit` handler
23+
* Added a `:stop_on_exit` option to thread pools to enable/disable `at_exit` handler
2424
* Updated thread pool docs to better explain shutting down thread pools
2525
* Simpler `:executor` option syntax for all abstractions which support this option
2626
* Added `Executor#auto_terminate?` predicate method (for thread pools)
@@ -43,6 +43,55 @@
4343
* Moved global logger up to the `Concurrent` namespace and refactored the code
4444
* Optimized the performance of `Delay`
4545
- Fixed a bug in which no executor option on construction caused block execution on a global thread pool
46+
* Numerous improvements and bug fixes to `TimerSet`
47+
* Fixed deadlock of `Future` when the handler raises Exception
48+
* Added shared specs for more classes
49+
* New concurrency abstractions including:
50+
- `Atom`
51+
- `Maybe`
52+
- `ImmutableStruct`
53+
- `MutableStruct`
54+
- `SettableStruct`
55+
* Created an Edge gem for unstable abstractions including
56+
- `Actor`
57+
- `Agent`
58+
- `Channel`
59+
- `Exchanger`
60+
- `LazyRegister`
61+
- **new Future Framework** <http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Edge.html> - unified
62+
implementation of Futures and Promises which combines Features of previous `Future`,
63+
`Promise`, `IVar`, `Event`, `Probe`, `dataflow`, `Delay`, `TimerTask` into single framework. It uses extensively
64+
new synchronization layer to make all the paths **lock-free** with exception of blocking threads on `#wait`.
65+
It offers better performance and does not block threads when not required.
66+
* Actor framework changes:
67+
- fixed reset loop in Pool
68+
- Pool can use any actor as a worker, abstract worker class is no longer needed.
69+
- Actor events not have format `[:event_name, *payload]` instead of just the Symbol.
70+
- Actor now uses new Future/Promise Framework instead of `IVar` for better interoperability
71+
- Behaviour definition array was simplified to `[BehaviourClass1, [BehaviourClass2, *initialization_args]]`
72+
- Linking behavior responds to :linked message by returning array of linked actors
73+
- Supervised behavior is removed in favour of just Linking
74+
- RestartingContext is supervised by default now, `supervise: true` is not required any more
75+
- Events can be private and public, so far only difference is that Linking will
76+
pass to linked actors only public messages. Adding private :restarting and
77+
:resetting events which are send before the actor restarts or resets allowing
78+
to add callbacks to cleanup current child actors.
79+
- Print also object_id in Reference to_s
80+
- Add AbstractContext#default_executor to be able to override executor class wide
81+
- Add basic IO example
82+
- Documentation somewhat improved
83+
- All messages should have same priority. It's now possible to send `actor << job1 << job2 << :terminate!` and
84+
be sure that both jobs are processed first.
85+
* Refactored `Channel` to use newer synchronization objects
86+
* Added `#reset` and `#cancel` methods to `TimerSet`
87+
* Added `#cancel` method to `Future` and `ScheduledTask`
88+
* Refactored `TimerSet` to use `ScheduledTask`
89+
* Updated `Async` with a factory that initializes the object
90+
* Deprecated `Concurrent.timer` and `Concurrent.timeout`
91+
* Reduced max threads on pure-Ruby thread pools (abends around 14751 threads)
92+
* Moved many private/internal classes/modules into "namespace" modules
93+
* Removed brute-force killing of threads in tests
94+
* Fixed a thread pool bug when the operating system cannot allocate more threads
4695

4796
## Current Release v0.8.0 (25 January 2015)
4897

README.md

Lines changed: 55 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Concurrent Ruby
2-
[![Gem Version](https://badge.fury.io/rb/concurrent-ruby.svg)](http://badge.fury.io/rb/concurrent-ruby) [![Build Status](https://travis-ci.org/ruby-concurrency/concurrent-ruby.svg?branch=master)](https://travis-ci.org/ruby-concurrency/concurrent-ruby) [![Coverage Status](https://img.shields.io/coveralls/ruby-concurrency/concurrent-ruby/master.svg)](https://coveralls.io/r/ruby-concurrency/concurrent-ruby) [![Code Climate](https://codeclimate.com/github/ruby-concurrency/concurrent-ruby.svg)](https://codeclimate.com/github/ruby-concurrency/concurrent-ruby) [![Inline docs](http://inch-ci.org/github/ruby-concurrency/concurrent-ruby.svg)](http://inch-ci.org/github/ruby-concurrency/concurrent-ruby) [![Dependency Status](https://gemnasium.com/ruby-concurrency/concurrent-ruby.svg)](https://gemnasium.com/ruby-concurrency/concurrent-ruby) [![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT) [![Gitter chat](http://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-brightgreen.svg)](https://gitter.im/ruby-concurrency/concurrent-ruby)
2+
[![Gem Version](https://badge.fury.io/rb/concurrent-ruby.svg)](http://badge.fury.io/rb/concurrent-ruby) [![Build Status](https://travis-ci.org/ruby-concurrency/concurrent-ruby.svg?branch=master)](https://travis-ci.org/ruby-concurrency/concurrent-ruby) [![Code Climate](https://codeclimate.com/github/ruby-concurrency/concurrent-ruby.svg)](https://codeclimate.com/github/ruby-concurrency/concurrent-ruby) [![Inline docs](http://inch-ci.org/github/ruby-concurrency/concurrent-ruby.svg)](http://inch-ci.org/github/ruby-concurrency/concurrent-ruby) [![Dependency Status](https://gemnasium.com/ruby-concurrency/concurrent-ruby.svg)](https://gemnasium.com/ruby-concurrency/concurrent-ruby) [![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT) [![Gitter chat](http://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-brightgreen.svg)](https://gitter.im/ruby-concurrency/concurrent-ruby)
33

44
<table>
55
<tr>
@@ -50,7 +50,7 @@ We also have a [mailing list](http://groups.google.com/group/concurrent-ruby).
5050

5151
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.
5252

53-
### High-level, general-purpose asynchronous concurrency abstractions
53+
#### General-purpose Concurrency Abstractions
5454

5555
* [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.
5656
* [Atom](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Atom.html): A way to manage shared, synchronous, independent state.
@@ -60,47 +60,58 @@ This library contains a variety of concurrency abstractions at high and low leve
6060
* [ScheduledTask](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/ScheduledTask.html): Like a Future scheduled for a specific future time.
6161
* [TimerTask](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/TimerTask.html): A Thread that periodically wakes up to perform work at regular intervals.
6262

63-
### Java-inspired ThreadPools and other executors
63+
#### Thread-safe Value Objects
6464

65-
* See [ThreadPool](http://ruby-concurrency.github.io/concurrent-ruby/file.thread_pools.html) overview, which also contains a list of other Executors available.
65+
* `Maybe` A thread-safe, immutable object representing an optional value, based on
66+
[Haskell Data.Maybe](https://hackage.haskell.org/package/base-4.2.0.1/docs/Data-Maybe.html).
67+
* `Delay` Lazy evaluation of a block yielding an immutable result. Based on Clojure's
68+
[delay](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Delay.html).
69+
70+
#### Thread-safe Structures
6671

67-
* Thread-safe structure classes derived from Ruby's [Struct](http://ruby-doc.org/core-2.2.0/Struct.html)
72+
Derived from Ruby's [Struct](http://ruby-doc.org/core-2.2.0/Struct.html):
6873

6974
* `ImmutableStruct` Immutable struct where values are set at construction and cannot be changed later.
7075
* `MutableStruct` Synchronized, mutable struct where values can be safely changed at any time.
7176
* `SettableStruct` Synchronized, write-once struct where values can be set at most once, either at construction or any time thereafter.
7277

73-
### Thread synchronization classes and algorithms
78+
#### Java-inspired ThreadPools and Other Executors
79+
80+
* See [ThreadPool](http://ruby-concurrency.github.io/concurrent-ruby/file.thread_pools.html) overview, which also contains a list of other Executors available.
81+
82+
#### Thread Synchronization Classes and Algorithms
7483

7584
* [CountdownLatch](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/CountDownLatch.html)
7685
* [CyclicBarrier](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/CyclicBarrier.html)
7786
* [Event](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Event.html)
7887
* [Semaphore](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Semaphore.html)
79-
* [Timeout](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent.html#timeout-class_method)
80-
* [Timer](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent.html#timer-class_method)
8188

82-
### Thread-safe variables
89+
#### Thread-safe Variables
8390

8491
* [AtomicBoolean](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/AtomicBoolean.html)
8592
* [AtomicFixnum](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/AtomicFixnum.html)
8693
* [AtomicReference](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/MutexAtomic.html)
87-
* [Delay](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Delay.html)
8894
* [I-Structures](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/IVar.html) (IVar)
8995
* [M-Structures](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/MVar.html) (MVar)
9096
* [Thread-local variables](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/ThreadLocalVar.html)
9197
* [Software transactional memory](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/TVar.html) (TVar)
9298
* [ReadWriteLock](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/ReadWriteLock.html)
9399

94-
### Edge features
100+
### Edge Features
95101

96-
They are available in the `concurrent-ruby-edge` companion gem, install with `gem install concurrent-ruby-edge`.
102+
These are available in the `concurrent-ruby-edge` companion gem, installed with `gem install concurrent-ruby-edge`.
97103

98104
These features are under active development and may change frequently. They are expected not to
99105
keep backward compatibility (there may also lack tests and documentation). Semantic versions will
100106
be obeyed though. Features developed in `concurrent-ruby-edge` are expected to move to `concurrent-ruby` when final.
101107

102108
* [Actor](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Actor.html):
103109
Implements the Actor Model, where concurrent actors exchange messages.
110+
* [new Future Framework](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Edge.html) - new
111+
unified implementation of Futures and Promises which combines Features of previous `Future`,
112+
`Promise`, `IVar`, `Event`, `Probe`, `dataflow`, `Delay`, `TimerTask` into single framework. It uses extensively
113+
new synchronization layer to make all the paths **lock-free** with exception of blocking threads on `#wait`.
114+
It offers better performance and does not block threads when not required.
104115
* [Agent](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Agent.html): A single atomic value that represents an identity.
105116
* [Channel](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Channel.html):
106117
Communicating Sequential Processes (CSP).
@@ -114,6 +125,17 @@ be obeyed though. Features developed in `concurrent-ruby-edge` are expected to m
114125
intended).
115126

116127

128+
#### Statuses:
129+
130+
*Why is not in core?*
131+
132+
- **Actor** - partial documentation and tests, stability good.
133+
- **Future/Promise Framework** - partial documentation and tests, stability good.
134+
- **Agent** - incomplete behaviour compared to Clojure's model, stability good.
135+
- **Channel** - missing documentation, stability good.
136+
- **Exchanger** - known race issue.
137+
- **LazyRegister** - missing documentation and tests.
138+
117139
## Usage
118140

119141
All abstractions within this gem can be loaded simply by requiring it:
@@ -131,32 +153,36 @@ require 'concurrent' # everything
131153

132154
require 'concurrent/atomics' # atomic and thread synchronization classes
133155
require 'concurrent/executors' # Thread pools and other executors
134-
require 'concurrent/utilities' # utility methods such as processor count and timers
135156

136157
# individual abstractions
137158

138-
require 'concurrent/agent' # Concurrent::Agent
139-
require 'concurrent/async' # Concurrent::Async
140-
require 'concurrent/atomic' # Concurrent::Atomic (formerly the `atomic` gem)
141-
require 'concurrent/dataflow' # Concurrent::dataflow
142-
require 'concurrent/delay' # Concurrent::Delay
143-
require 'concurrent/exchanger' # Concurrent::Exchanger
144-
require 'concurrent/future' # Concurrent::Future
145-
require 'concurrent/ivar' # Concurrent::IVar
146-
require 'concurrent/lazy_register' # Concurrent::LazyRegister
147-
require 'concurrent/mvar' # Concurrent::MVar
148-
require 'concurrent/promise' # Concurrent::Promise
149-
require 'concurrent/scheduled_task' # Concurrent::ScheduledTask
150-
require 'concurrent/timer_task' # Concurrent::TimerTask
151-
require 'concurrent/tvar' # Concurrent::TVar
159+
require 'concurrent/async' # Concurrent::Async
160+
require 'concurrent/atom' # Concurrent::Atom
161+
require 'concurrent/dataflow' # Concurrent::dataflow
162+
require 'concurrent/delay' # Concurrent::Delay
163+
require 'concurrent/future' # Concurrent::Future
164+
require 'concurrent/immutable_struct' # Concurrent::ImmutableStruct
165+
require 'concurrent/ivar' # Concurrent::IVar
166+
require 'concurrent/maybe' # Concurrent::Maybe
167+
require 'concurrent/mutable_struct' # Concurrent::MutableStruct
168+
require 'concurrent/mvar' # Concurrent::MVar
169+
require 'concurrent/promise' # Concurrent::Promise
170+
require 'concurrent/scheduled_task' # Concurrent::ScheduledTask
171+
require 'concurrent/settable_struct' # Concurrent::SettableStruct
172+
require 'concurrent/timer_task' # Concurrent::TimerTask
173+
require 'concurrent/tvar' # Concurrent::TVar
152174

153175
# experimental - available in `concurrent-ruby-edge` companion gem
154176

155177
require 'concurrent/actor' # Concurrent::Actor and supporting code
178+
require 'concurrent/edge/future' # new Future Framework
179+
require 'concurrent/agent' # Concurrent::Agent
156180
require 'concurrent/channel ' # Concurrent::Channel and supporting code
181+
require 'concurrent/exchanger' # Concurrent::Exchanger
182+
require 'concurrent/lazy_register' # Concurrent::LazyRegister
157183
```
158184

159-
If the library does not behave as expected, `Concurrent.use_stdlib_logger(Logger::DEBUG)` could help to revel the problem.
185+
If the library does not behave as expected, `Concurrent.use_stdlib_logger(Logger::DEBUG)` could help to reveal the problem.
160186

161187
## Installation
162188

@@ -241,7 +267,7 @@ bundle exec rake compile # Compile all the extensions
241267
* [Petr Chalupa](https://github.com/pitr-ch)
242268
* [Paweł Obrok](https://github.com/obrok)
243269

244-
### Contributing
270+
## Contributing
245271

246272
1. Fork it
247273
2. Create your feature branch (`git checkout -b my-new-feature`)

lib/concurrent/edge/future.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Concurrent
88
# Provides edge features, which will be added to or replace features in main gem.
99
#
1010
# Contains new unified implementation of Futures and Promises which combines Features of previous `Future`,
11-
# `Promise`, `IVar`, `Probe`, `dataflow`, `Delay`, `TimerTask` into single framework. It uses extensively
11+
# `Promise`, `IVar`, `Event`, `Probe`, `dataflow`, `Delay`, `TimerTask` into single framework. It uses extensively
1212
# new synchronization layer to make all the paths lock-free with exception of blocking threads on `#wait`.
1313
# It offers better performance and does not block threads (exception being `#wait` and similar methods where it's
1414
# intended).

0 commit comments

Comments
 (0)