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

Make synchronous reads and writes to the container safe #540

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

dalemyers
Copy link

The services parameter is not thread safe. Concurrent reads are safe, but concurrent reads with writes happening at the same time are not. This adds a read/write lock around it, making reads synchronous and safe, but writes block to ensure safety.

Resolves #539

The `services` parameter is not thread safe. Concurrent reads are safe, but concurrent reads with writes happening at the same time are not. This adds a read/write lock around it, making reads synchronous and safe, but writes block to ensure safety.

Resolves Swinject#539
@Goles
Copy link

Goles commented Oct 9, 2023

Seeing the same thing. Thanks for working on this.

@dalemyers
Copy link
Author

@mpdifran / @maxim-chipeev Any chance of a review on this? Thanks! 😄

@dalemyers
Copy link
Author

@mpdifran / @maxim-chipeev Just bumping this again as we are still seeing it and we'd really rather not have to fork.

Copy link
Contributor

@maxim-chipeev maxim-chipeev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the follow-up ping—and for adding the functionality, I will merge this in for the use-case of concurrent writes to the container.

@maxim-chipeev maxim-chipeev merged commit 299b2d8 into Swinject:master Jan 16, 2024
@dalemyers dalemyers deleted the dalemyers/threadsafty branch January 16, 2024 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Synchronous reads and writes fail
3 participants