ruby-concurrency / ruby-concurrency/concurrent-ruby
CAtomicFixnum should probably be a private constant
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 5.8k
- Forks
- 420
- Avg merge
- 20h 45m
- Merged PRs (30d)
- 4
Description
Otherwise we get misleading suggestions from did-you-mean in case concurrent/atomic/atomic_fixnum is not required but the extension is loaded like:
NameError:
uninitialized constant Concurrent::AtomicFixnum
counter = AtomicFixnum.new
^^^^^^^^^^^^
Did you mean? Concurrent::CAtomicFixnum
# ./spec/concurrent/atomic/cyclic_barrier_spec.rb:106:in `block (4 levels) in <module:Concurrent>'
Note that even if it's private, did-you-mean is still kind of misleading:
NameError:
uninitialized constant Concurrent::AtomicFixnum
counter = AtomicFixnum.new
^^^^^^^^^^^^
Did you mean? Concurrent::AtomicReference
# ./spec/concurrent/atomic/cyclic_barrier_spec.rb:191:in `block (5 levels) in <module:Concurrent>'
And there are various specs checking defined? Concurrent::CAtomicFixnum and even a benchmark referencing Concurrent::CAtomicFixnum, so it's not so easy to make it private unfortunately.
Unclear if worth fixing. WIP at https://github.com/ruby-concurrency/concurrent-ruby/compare/master...eregon:concurrent-ruby:private-AtomicFixnum
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the constant definitions and the specs mentioned in the issue, especially spec/concurrent/atomic/cyclic_barrier_spec.rb, then inspect the WIP comparison branch. Search for specs and benchmark references to Concurrent::CAtomicFixnum. Done means resolving whether the constant can be private without leaving those references inconsistent or retaining the misleading suggestion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100