Talks
Speakers
Events
Topics
Search
Sign in
Search
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
search talks for
⏎
Suggest modification to this talk
Title
Description
Writing concurrent libraries for all Ruby runtimes by Petr Chalupa Have you ever wondered how to use all of your cores? The talk will take you on a path of writing a simple concurrent class. We'll start with a basic implementation and gradually improve it based on presented problems and newly learned facts. Our final solution will behave well in the face of concurrency and execute consistently on all Ruby implementations. We’ll investigate various Ruby runtime differences that we’ve abstracted away with the synchronization layer of the concurrent-ruby gem. We'll go down to JRuby extensions, even volatile fields and compare-and-swap operations.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In the talk 'Writing Concurrent Libraries for All Ruby Runtimes' presented by Petr Chalupa at RubyConf 2015, the focus is on creating concurrent classes that leverage the full capability of multicore processors within Ruby environments. The presentation begins with an introduction to the Concurrent Ruby gem, which offers both high-level and low-level concurrent abstractions suitable for MRI, Ruby 1.9, and forthcoming support for Rubinius. Key points discussed include: - **Concurrent Ruby Overview**: This library includes features such as chainable futures, channels, actors, and transactional memory. It utilizes synchronization primitives to facilitate the development of concurrent applications. - **Jariabek Project**: An experimental backend for JRuby that acts as a self-optimizing Abstract Syntax Tree (AST) interpreter to improve execution performance. - **Understanding Concurrency Challenges**: Chalupa explains the complexity of concurrency, focusing on how compilers and processors can reorder execution while maintaining sequential consistency, which can create unexpected behavior if not properly managed. - **Building a Future Abstraction**: A simple `Future` class is created to represent a computation that is not yet complete. Chalupa discusses the API and illustrates its use for background processing using worker threads that manage job queues. - **Implementation Details**: The presentation explores performance implications and the importance of synchronization, particularly in MRI where the Global Virtual Machine Lock (GVL) is utilized. Chalupa demonstrates how to enhance the basic `Future` implementation to avoid unnecessary synchronization overhead. - **JRuby Considerations**: The importance of ensuring that instance variables are safely shared across threads is emphasized, and elements of the Ruby core API in JRuby are adapted to maintain concurrency without compromising performance. - **Performance Benchmarking**: Performance comparisons across implementations highlight the improved speed and efficiency of concurrent code in JRuby. Chalupa concludes by emphasizing that developers should start with the Concurrent Ruby gem for concurrent programming needs and offers assistance for those looking to implement or extend functionalities. The talk highlights the ongoing evolution of concurrency in Ruby, alongside a promise to maintain compatibility with future Ruby releases. Overall, the key takeaways stress the importance of understanding concurrency complexities and utilizing libraries that abstract those challenges effectively.
Suggest modifications
Cancel