Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LazyRegister concurrent register bug #819

Open
kvokka opened this issue Aug 24, 2019 · 3 comments
Open

LazyRegister concurrent register bug #819

kvokka opened this issue Aug 24, 2019 · 3 comments
Assignees
Labels
enhancement Adding features, adding tests, improving documentation.

Comments

@kvokka
Copy link

kvokka commented Aug 24, 2019

If yout take a look at

def register(key, &block)
you will see, that it has a bug.

When block evaluation time is stochastic, then even 2 register calls will produce unpredictable result.

* `concurrent-ruby` version:       master
* `concurrent-ruby-edge` used:     yes

Will be happy to fix it, if u don't mind.

@pitr-ch
Copy link
Member

pitr-ch commented Aug 24, 2019

Thank you for you interest. However, I don't see the problem, could you please elaborate. Thanks.

@pitr-ch pitr-ch added the bug A bug in the library or documentation. label Aug 24, 2019
@pitr-ch pitr-ch added this to Nope in Hackathon Aug 24, 2019
@kvokka
Copy link
Author

kvokka commented Aug 24, 2019

Thank you for such a quick response.

After spending some time, I realized, that the is no a word about concurrent write of user data, only the registry itself. So, the developer should to manage it. This means, that for my case I should create a subclass, which allows the concurrent immutable access to the data.

Will do it anyway for my needs. Is it good idea to add it as a PR to -edge afterwards?

@pitr-ch
Copy link
Member

pitr-ch commented Aug 25, 2019

What is your use-case?
Yeah keep the new class next to the lazy_reqister in edge for now please. I would recommend to submit a draft PR so we can discuss early. Thanks!

@pitr-ch pitr-ch added enhancement Adding features, adding tests, improving documentation. and removed bug A bug in the library or documentation. labels Aug 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding features, adding tests, improving documentation.
Development

No branches or pull requests

2 participants