ruby-concurrency /concurrent-ruby

Modern concurrency tools including agents, futures, promises, thread pools, supervisors, and more. Inspired by Erlang, Clojure, Scala, Go, Java, JavaScript, and classic concurrency patterns.

★ 5,836⑂ 424👁 113⑃ 681● 429▤ 62
RubyNOASSERTIONCreated 2013-07-23ruby-concurrency.github.io/concurrent-ruby/
下载:v1.3.8v1.3.8 ↓1.3.82026-07-19
+1
日增长
5,836
stars
424
forks
113
watchers
681
prs
429
issues
62
releases

README

Concurrent Ruby



![Gitter chat-devs%20%26%20users-brightgreen.svg)](https://gitter.im/ruby-concurrency/concurrent-ruby)

Modern concurrency tools for Ruby. Inspired by
Erlang,
Clojure,
Scala,
Haskell,
F,
C,
Java,
and classic concurrency patterns.



The design goals of this gem are:

   Be an 'unopinionated' toolbox that provides useful utilities without debating which is better 
    or why
   Remain free of external gem dependencies
   Stay true to the spirit of the languages providing inspiration
   But implement in a way that makes sense for Ruby
   Keep the semantics as idiomatic Ruby as possible
   Support features that make sense in Ruby
   Exclude features that don't make sense in Ruby
   Be small, lean, and loosely coupled
   Thread-safety
   Backward compatibility

 Contributing

This gem depends on 
contributions and we 
appreciate your help. Would you like to contribute? Great! Have a look at 
issues with looking-for-contributor label. And if you pick something up let us know on the issue.

You can also get started by triaging issues which may include reproducing bug reports or asking for vital information, such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to subscribe to concurrent-ruby on CodeTriage. 

 Thread Safety

Concurrent Ruby makes one of the strongest thread safety guarantees of any Ruby concurrency 
library, providing consistent behavior and guarantees on all three main Ruby interpreters
(MRI/CRuby, JRuby, TruffleRuby).

Every abstraction in this library is thread safe. Specific thread safety guarantees are documented 
with each abstraction.

It is critical to remember, however, that Ruby is a language of mutable references. No
concurrency library for Ruby can ever prevent the user from making thread safety mistakes (such as
sharing a mutable object between threads and modifying it on both threads) or from creating
deadlocks through incorrect use of locks. All the library can do is provide safe abstractions which
encourage safe practices. Concurrent Ruby provides more safe concurrency abstractions than any
other Ruby library, many of which support the mantra of 
"Do not communicate by sharing memory; instead, share memory by communicating".
Concurrent Ruby is also the only Ruby library which provides a full suite of thread safe and
immutable variable types and data structures.

We've also initiated discussion to document the memory model of Ruby which 
would provide consistent behaviour and guarantees on all three main Ruby interpreters 
(MRI/CRuby, JRuby, TruffleRuby).

 Features & Documentation

The primary site for documentation is the automatically generated 
API documentation which is up to 
date with latest release. This readme matches the master so may contain new stuff not yet 
released.

We also have a IRC (gitter).

 Versioning

   concurrent-ruby uses Semantic Versioning
   concurrent-ruby-ext has always same version as concurrent-ru

Top issues

Discussions

Latest release

v1.3.8 v1.3.8 2026-07-19
What's Changed
 Programatically set the backtrace_location on exception by @Edouard-chin in https://github.com/ruby-concurrency/concurrent-ruby/pull/1107
 Allow to use Concurrent::Mapcompute_if_absent in a Ractor by @Edouard-chin in https://github.com/ruby-concurrency/concurrent-ruby/pull/1109

 New Contributors
 @Edouard-chin made their first contribution in https://github.com/ruby-concurrency/concurrent-ruby/pull/1107

Full Changelog: https://github.com/ruby-concurrency/concurrent-ruby/compare/v1.3.7...v1.3.8

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON