-
Notifications
You must be signed in to change notification settings - Fork 0
Google Summer of Code 2014
This page hosts the ideas for Google Summer of Code 2014! Add your ideas here, improve others, and if you're a student, perhaps something on this list will interest you!
Implement some kind of native coroutine support for JRuby. Bonus points for an implementation which is compatible with the Fiber API. One potential approach:
The Continuations Library by Matthias Mann provides the basis for lightweight coroutines on the JVM used by the Pulsar and Quasar libraries to achieve feats like 10,000 actors on the JVM.
It would be great if this library could be leveraged from JRuby, either with a proprietary API, or with an implementation of Fibers which is backed by this library.
Celluloid is an actor-based concurrent object framework (somewhat similar to Akka) written in pure Ruby. This means it presently uses Ruby Mutexes and ConditionVariables for synchronization. However, the JVM has many, many other options which could provide better performance.
The goal of this project would be to implement a duck type of the Celluloid::Mailbox class that leverages native JVM facilities to improve performance. Some examples to consider might be:
- LMAX Disruptor: Disruptor is a library which supports a number of different patterns for multithreaded execution. The main way LMAX could benefit Celluloid would be providing a way to preallocate and recycle inter-actor messages, storing them in a RingBuffer and providing cache-friendly operation while reducing the allocation rate and thus the demands on the GC. It's unclear if Disruptor's concurrency model could map to Celluloid's well, but it could be used in conjunction with the above data structures specifically for the purposes of leveraging preallocation. Some work has already been done to implement Celluloid Mailboxes in terms of Disruptor
- ArrayBlockingQueue: These are fast, fixed-sized data structures built atop arrays. Their bounded size might require some semantic changes to Celluloid (see this ticket for discussion on bounded mailboxes) but are probably the simplest way to improve performance on Celluloid.
- LinkedTransferQueue: Introduced in Java 7, LinkedTransferQueue could provide Celluloid's existing unbounded semantics with better performance than Java's previous linked queues. LinkedTransferQueues are a bit complicated and support lots of different modes of operation, so mapping them specifically to Celluloid's semantics might be a bit difficult.