- Support Alpha with
Concurrent::processor_count
- Fix bug with
Concurrent::Map
MRI backend#inspect
method - Fix bug with
Concurrent::Map
MRI backend usingHash#value?
- Improved documentation and examples
- Minor updates to Edge
- Fix "uninitialized constant Concurrent::ReentrantReadWriteLock" error.
- Better handling of
autoload
vs.require
. - Improved API for Edge
Future
zipping. - Fix reference leak in Edge
Future
constructor . - Fix bug which prevented thread pools from surviving a
fork
. - Fix bug in which
TimerTask
did not correctly specify all its dependencies. - Improved support for JRuby+Truffle
- Improved error messages.
- Improved documentation.
- Updated README and CONTRIBUTING.
- Rename
attr_volatile_with_cas
toattr_atomic
- Add
clear_each
toLockFreeStack
- Update
AtomicReference
documentation - Further updates and improvements to the synchronization layer.
- Performance and memory usage performance with
Actor
logging. - Fixed
ThreadPoolExecutor
task count methods. - Improved
Async
performance for both short and long-lived objects. - Fixed bug in
LockFreeLinkedSet
. - Fixed bug in which
Agent#await
triggered a validation failure. - Further
Channel
updates. - Adopted a project Code of Conduct
- Cleared interpreter warnings
- Fixed bug in
ThreadPoolExecutor
task count methods - Fixed bug in 'LockFreeLinkedSet'
- Improved Java extension loading
- Handle Exception children in Edge::Future
- Continued improvements to channel
- Removed interpreter warnings.
- Shared constants now in
lib/concurrent/constants.rb
- Refactored many tests.
- Improved synchronization layer/memory model documentation.
- Bug fix in Edge
Future#flat
- Brand new
Channel
implementation in Edge gem. - Simplification of
RubySingleThreadExecutor
Async
improvements- Each object uses its own
SingleThreadExecutor
instead of the global thread pool. - No longers supports executor injection
- Much better documentation
- Each object uses its own
Atom
updates- No longer
Dereferenceable
- Now
Observable
- Added a
#reset
method
- No longer
- Brand new
Agent
API and implementation. Now functionally equivalent to Clojure. - Continued improvements to the synchronization layer
- Merged in the
thread_safe
gemConcurrent::Array
Concurrent::Hash
Concurrent::Map
(formerly ThreadSafe::Cache)Concurrent::Tuple
- Minor improvements to Concurrent::Map
- Complete rewrite of
Exchanger
- Removed all deprecated code (classes, methods, constants, etc.)
- Updated Agent, MutexAtomic, and BufferedChannel to inherit from Synchronization::Object.
- Many improved tests
- Some internal reorganization
- Fixed a Rubiniux bug in synchronization object
- Fixed all interpreter warnings (except circular references)
- Fixed require statements when requiring
Atom
alone - Significantly improved
ThreadLocalVar
on non-JRuby platforms - Fixed error handling in Edge
Concurrent.zip
AtomicFixnum
methods#increment
and#decrement
now support optional delta- New
AtomicFixnum#update
method - Minor optimizations in
ReadWriteLock
- New
ReentrantReadWriteLock
class ThreadLocalVar#bind
method is now public- Refactored many tests
- Updated
AtomicReference
AtomicReference#try_update
now simply returns instead of raising exceptionAtomicReference#try_update!
was added to raise exceptions if an update fails. Note: this is the same behavior as the oldtry_update
- Pure Java implementations of
AtomicBoolean
AtomicFixnum
Semaphore
- Fixed bug when pruning Ruby thread pools
- Fixed bug in time calculations within
ScheduledTask
- Default
count
inCountDownLatch
to 1 - Use monotonic clock for all timers via
Concurrent.monotonic_time
- Use
Process.clock_gettime(Process::CLOCK_MONOTONIC)
when available - Fallback to
java.lang.System.nanoTime()
on unsupported JRuby versions - Pure Ruby implementation for everything else
- Effects
Concurrent.timer
,Concurrent.timeout
,TimerSet
,TimerTask
, andScheduledTask
- Use
- Deprecated all clock-time based timer scheduling
- Only support scheduling by delay
- Effects
Concurrent.timer
,TimerSet
, andScheduledTask
- Added new
ReadWriteLock
class - Consistent
at_exit
behavior for Java and Ruby thread pools. - Added
at_exit
handler to Ruby thread pools (already in Java thread pools)- Ruby handler stores the object id and retrieves from
ObjectSpace
- JRuby disables
ObjectSpace
by default so that handler stores the object reference
- Ruby handler stores the object id and retrieves from
- Added a
:stop_on_exit
option to thread pools to enable/disableat_exit
handler - Updated thread pool docs to better explain shutting down thread pools
- Simpler
:executor
option syntax for all abstractions which support this option - Added
Executor#auto_terminate?
predicate method (for thread pools) - Added
at_exit
handler toTimerSet
- Simplified auto-termination of the global executors
- Can now disable auto-termination of global executors
- Added shutdown/kill/wait_for_termination variants for global executors
- Can now disable auto-termination for all executors (the nuclear option)
- Simplified auto-termination of the global executors
- Deprecated terms "task pool" and "operation pool"
- New terms are "io executor" and "fast executor"
- New functions added with new names
- Deprecation warnings added to functions referencing old names
- Moved all thread pool related functions from
Concurrent::Configuration
toConcurrent
- Old functions still exist with deprecation warnings
- New functions have updated names as appropriate
- All high-level abstractions default to the "io executor"
- Fixed bug in
Actor
causing it to prematurely warm global thread pools on gem load- This also fixed a
RejectedExecutionError
bug when running with minitest/autorun via JRuby
- This also fixed a
- Moved global logger up to the
Concurrent
namespace and refactored the code - Optimized the performance of
Delay
- Fixed a bug in which no executor option on construction caused block execution on a global thread pool
- Numerous improvements and bug fixes to
TimerSet
- Fixed deadlock of
Future
when the handler raises Exception - Added shared specs for more classes
- New concurrency abstractions including:
Atom
Maybe
ImmutableStruct
MutableStruct
SettableStruct
- Created an Edge gem for unstable abstractions including
Actor
Agent
Channel
Exchanger
LazyRegister
- new Future Framework http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Edge.html - unified
implementation of Futures and Promises which combines Features of previous
Future
,Promise
,IVar
,Event
,Probe
,dataflow
,Delay
,TimerTask
into single framework. It uses extensively new synchronization layer to make all the paths lock-free with exception of blocking threads on#wait
. It offers better performance and does not block threads when not required.
- Actor framework changes:
- fixed reset loop in Pool
- Pool can use any actor as a worker, abstract worker class is no longer needed.
- Actor events not have format
[:event_name, *payload]
instead of just the Symbol. - Actor now uses new Future/Promise Framework instead of
IVar
for better interoperability - Behaviour definition array was simplified to
[BehaviourClass1, [BehaviourClass2, *initialization_args]]
- Linking behavior responds to :linked message by returning array of linked actors
- Supervised behavior is removed in favour of just Linking
- RestartingContext is supervised by default now,
supervise: true
is not required any more - Events can be private and public, so far only difference is that Linking will pass to linked actors only public messages. Adding private :restarting and :resetting events which are send before the actor restarts or resets allowing to add callbacks to cleanup current child actors.
- Print also object_id in Reference to_s
- Add AbstractContext#default_executor to be able to override executor class wide
- Add basic IO example
- Documentation somewhat improved
- All messages should have same priority. It's now possible to send
actor << job1 << job2 << :terminate!
and be sure that both jobs are processed first.
- Refactored
Channel
to use newer synchronization objects - Added
#reset
and#cancel
methods toTimerSet
- Added
#cancel
method toFuture
andScheduledTask
- Refactored
TimerSet
to useScheduledTask
- Updated
Async
with a factory that initializes the object - Deprecated
Concurrent.timer
andConcurrent.timeout
- Reduced max threads on pure-Ruby thread pools (abends around 14751 threads)
- Moved many private/internal classes/modules into "namespace" modules
- Removed brute-force killing of threads in tests
- Fixed a thread pool bug when the operating system cannot allocate more threads
- C extension for MRI have been extracted into the
concurrent-ruby-ext
companion gem. Please see the README for more detail. - Better variable isolation in
Promise
andFuture
via an:args
option - Continued to update intermittently failing tests
- New
Semaphore
class based on java.util.concurrent.Semaphore - New
Promise.all?
andPromise.any?
class methods - Renamed
:overflow_policy
on thread pools to:fallback_policy
- Thread pools still accept the
:overflow_policy
option but display a warning - Thread pools now implement
fallback_policy
behavior when not running (rather than universally rejecting tasks) - Fixed minor
set_deref_options
constructor bug inPromise
class - Fixed minor
require
bug inThreadLocalVar
class - Fixed race condition bug in
TimerSet
class - Fixed race condition bug in
TimerSet
class - Fixed signal bug in
TimerSet#post
method - Numerous non-functional updates to clear warning when running in debug mode
- Fixed more intermittently failing tests
- Tests now run on new Travis build environment
- Multiple documentation updates
Please see the roadmap for more information on the next planned release.
- Added
flat_map
method toPromise
- Added
zip
method toPromise
- Fixed bug with logging in
Actor
- Improvements to
Promise
tests - Removed actor-experimental warning
- Added an
IndirectImmediateExecutor
class - Allow disabling auto termination of global executors
- Fix thread leaking in
ThreadLocalVar
(usesRef
gem on non-JRuby systems) - Fix thread leaking when pruning pure-Ruby thread pools
- Prevent
Actor
from using anImmediateExecutor
(causes deadlock) - Added missing synchronizations to
TimerSet
- Fixed bug with return value of
Concurrent::Actor::Utils::Pool#ask
- Fixed timing bug in
TimerTask
- Fixed bug when creating a
JavaThreadPoolExecutor
with minimum pool size of zero - Removed confusing warning when not using native extenstions
- Improved documentation
- Merge the atomic gem
- Pure Ruby
MutexAtomic
atomic reference class - Platform native atomic reference classes
CAtomic
,JavaAtomic
, andRbxAtomic
- Automated build process
- Fat binary releases for multiple platforms including Windows (32/64), Linux (32/64), OS X (64-bit), Solaris (64-bit), and JRuby
- Pure Ruby
- C native
CAtomicBoolean
- C native
CAtomicFixnum
- Refactored intermittently failing tests
- Added
dataflow!
anddataflow_with!
methods to matchFuture#value!
method - Better handling of timeout in
Agent
- Actor Improvements
- Fine-grained implementation using chain of behaviors. Each behavior is responsible for single aspect like:
Termination
,Pausing
,Linking
,Supervising
, etc. Users can create custom Actors easily based on their needs. - Supervision was added.
RestartingContext
will pause on error waiting on its supervisor to decide what to do next ( options are:terminate!
,:resume!
,:reset!
,:restart!
). Supervising behavior also supports strategies:one_for_one
and:one_for_all
. - Linking was added to be able to monitor actor's events like:
:terminated
,:paused
,:restarted
, etc. - Dead letter routing added. Rejected envelopes are collected in a configurable actor (default:
Concurrent::Actor.root.ask!(:dead_letter_routing)
) - Old
Actor
class removed and replaced by new implementation previously calledActress
.Actress
was kept as an alias forActor
to keep compatibility. Utils::Broadcast
actor which allows Publish–subscribe pattern.
- Fine-grained implementation using chain of behaviors. Each behavior is responsible for single aspect like:
- More executors for managing serialized operations
SerializedExecution
mixin moduleSerializedExecutionDelegator
for serializing any executor
- Updated
Async
with serialized execution - Updated
ImmediateExecutor
andPerThreadExecutor
with full executor service lifecycle - Added a
Delay
to rootActress
initialization - Minor bug fixes to thread pools
- Refactored many intermittently failing specs
- Removed Java interop warning
executor.rb:148 warning: ambiguous Java methods found, using submit(java.lang.Runnable)
- Fixed minor bug in
RubyCachedThreadPool
overflow policy - Updated tests to use RSpec 3.0
- Removed deprecated
Actor
class - Better support for Rubinius
- Many improvements to
Concurrent::Actress
- Bug fixes to
Concurrent::RubyThreadPoolExecutor
- Fixed several brittle tests
- Moved documentation to http://ruby-concurrency.github.io/concurrent-ruby/frames.html
- Added
Concurrent::Observable
to encapsulate our thread safe observer sets - Improvements to new
Channel
- Major improvements to
CachedThreadPool
andFixedThreadPool
- Added
SingleThreadExecutor
- Added
Current::timer
function - Added
TimerSet
executor - Added
AtomicBoolean
ScheduledTask
refactoring- Pure Ruby and JRuby-optimized
PriorityQueue
classes - Updated
Agent
behavior to more closely match Clojure - Observer sets support block callbacks to the
add_observer
method - New algorithm for thread creation in
RubyThreadPoolExecutor
- Minor API updates to
Event
- Rewritten
TimerTask
now anExecutor
instead of aRunnable
- Fixed many brittle specs
- Renamed
FixedThreadPool
andCachedThreadPool
toRubyFixedThreadPool
andRubyCachedThreadPool
- Created JRuby optimized
JavaFixedThreadPool
andJavaCachedThreadPool
- Consolidated fixed thread pool tests into
spec/concurrent/fixed_thread_pool_shared.rb
andspec/concurrent/cached_thread_pool_shared.rb
FixedThreadPool
now subclassesRubyFixedThreadPool
orJavaFixedThreadPool
as appropriateCachedThreadPool
now subclassesRubyCachedThreadPool
orJavaCachedThreadPool
as appropriate- New
Delay
class Concurrent::processor_count
helper function- New
Async
module - Renamed
NullThreadPool
toPerThreadExecutor
- Deprecated
Channel
(we are planning a new implementation based on Go) - Added gem-level configuration
- Deprecated
$GLOBAL_THREAD_POOL
in lieu of gem-level configuration - Removed support for Ruby 1.9.2
- New
RubyThreadPoolExecutor
andJavaThreadPoolExecutor
classes - All thread pools now extend the appropriate thread pool executor classes
- All thread pools now support
:overflow_policy
(based on Java's reject policies) - Deprecated
UsesGlobalThreadPool
in lieu of explicit:executor
option (dependency injection) onFuture
,Promise
, andAgent
- Added
Concurrent::dataflow_with(executor, *inputs)
method to support executor dependency injection for dataflow - Software transactional memory with
TVar
andConcurrent::atomically
- First implementation of new, high-performance
Channel
Actor
is deprecated in favor of new experimental actor implementation #73. To avoid namespace collision it is living inActress
namespace untilActor
is removed in next release.
This is the most significant release of this gem since its inception. This release includes many improvements and optimizations. It also includes several bug fixes. The major areas of focus for this release were:
- Stability improvements on Ruby versions with thread-level parallelism (JRuby and Rubinius)
- Creation of new low-level concurrency abstractions
- Internal refactoring to use the new low-level abstractions
Most of these updates had no effect on the gem API. There are a few notable exceptions which were unavoidable. Please read the release notes for more information.
Specific changes include:
- New class
IVar
- New class
MVar
- New class
ThreadLocalVar
- New class
AtomicFixnum
- New class method
dataflow
- New class
Condition
- New class
CountDownLatch
- New class
DependencyCounter
- New class
SafeTaskExecutor
- New class
CopyOnNotifyObserverSet
- New class
CopyOnWriteObserverSet
Future
updated withexecute
APIScheduledTask
updated withexecute
API- New
Promise
API Future
now extendsIVar
Postable#post?
now returns anIVar
- Thread safety fixes to
Dereferenceable
- Thread safety fixes to
Obligation
- Thread safety fixes to
Supervisor
- Thread safety fixes to
Event
- Various other thread safety (race condition) fixes
- Refactored brittle tests
- Implemented pending tests
- Added JRuby and Rubinius as Travis CI build targets
- Added CodeClimate code review
- Improved YARD documentation