Skip to content

Merging the thread_safe gem #230

Closed
Closed
@jdantonio

Description

@jdantonio

When this gem was first given to us the plan was to merge the code into concurrent-ruby and deprecate this gem. We chose to focus on atomic first and have now had two releases with the merged code. We're now discussing the final deprecation of atomic. Now is a good time to turn our attention to thread_safe. Before we start the work there are a couple of things we should discuss. In no particular order:

  • We should probably issue one final release of thread_safe with a deprecation warning. This will allow current users to keep using the gem if they don't want to switch to concurrent-ruby (Rails, for example).
  • Everything in concurrent-ruby exists under the Concurrent namespace. When we merge we should change the namespacing but provide backward-compatible aliases to ease migration. We did this with atomic.
  • This gem uses minitest but concurrent-ruby uses rspec. We updated all the atomic tests to use rspec and probably should do that for this gem.
  • In concurrent-ruby we have committed to providing pure-Ruby implementations of all abstractions so that we can be compatible with the widest range of Ruby interpreters. For ThreadSafe::Array and ThreadSafe::Hash this gem defaults to MRI's native array and has implementations. For consistency we should create pure Ruby versions.
  • We should also consider whether the aforementioned use of MRI's array and hash classes are reliable. MRI does not have a published memory model and makes no guarantees regarding concurrency. As the code comment states, "should usually work fine." But that isn't a guarantee. For consistency with concurrent-ruby we may want to reconsider.
  • Since concurrent-ruby now has a companion gem for C extensions we should also consider creating a C variant of the Java extension.

Depending on how quickly we make these decisions and move forward with the work we could potentially have the initial implementation available for the 0.9.0 release.

The previous discussion of this merge can be found here.

Thoughts?

@pitr-ch @mighe @chrisseaton @obrok @lucasallan @colinsurprenant @headius @thedarkone

Metadata

Metadata

Assignees

Labels

enhancementAdding features, adding tests, improving documentation.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions