Skip to content

Feature Request: AtomicInteger #736

@herwinw

Description

@herwinw

Ruby has deprecated the Fixnum class in favour of a more generic Integer class (example blog post). The class Concurrent::AtomicFixnum still uses the Fixnum limits. This means the maximum value of this class depends on the architecture of the system.

At least when using MRI this doesn't make much sense anymore (not sure about C extensions, JRuby or Rubinius). It looks pretty trivial to create a AtomicInteger object, just remove the call to NativeInteger.ensure_integer_and_bounds. It could get min and max keyword arguments to specify new limits (which would make it possible to create a nAtomicFixnum based on AtomicInteger with the current boundaries and remove the code duplication)

I think it's pretty simple trivial to implement, so if the team agrees to this I'm willing to create the pull request for it

Metadata

Metadata

Assignees

Labels

enhancementAdding features, adding tests, improving documentation.looking-for-contributorWe are looking for a contributor to help with this issue.medium-priorityShould be done soon.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions