Concurrent Ruby v0.9.0 Release Notes
Release Date: 2015-07-10 // almost 9 years ago-
- ⚡️ 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
- 0️⃣ 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
- 0️⃣ 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
- ⚡️ Updated