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

Ensure thread safety where possible #326

Open
nalimilan opened this issue Feb 10, 2021 · 0 comments
Open

Ensure thread safety where possible #326

nalimilan opened this issue Feb 10, 2021 · 0 comments

Comments

@nalimilan
Copy link
Member

It doesn't sound possible to fully ensure CategoricalArray is thread-safe since it would be too costly to take a lock on each read, and probably also on each write. But at least it should be acceptable to take a lock when adding new levels. That level of protection can be useful at least to avoid issues when the first thing that multiple threads do is to add new levels to a CategoricalArray, notably when it's empty and without any levels. As long as the pool isn't mutated after that (like in JuliaData/DataFrames.jl#2588 (comment)) and no thread tries to read in the meantime, everything would be thread-safe.

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

No branches or pull requests

1 participant