You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replaced Locking on ValueType.BOOLEAN with locking based on ArrayType:
BitSetArray requires locking due to underlying storage in longs. Small Array are safe if they are shorter than 64 rows (using underlying Byte[]) a. Once above that threshold, the array is turned into a BitSetArray
OptionalArray has an underlying null-mask, indicating the null entries. That null-mask is based on a BitSetArray and is not thread-safe.
Additional ArrayTypes that are locked:
RaggedArray: internal resizing should cause race conditions. The set()/append() methods all contained a reset() into set() segment which has no guarantee of being atomic.
DDCArray/ACompressedArray: Similar to RaggedArrays, modifications are not atomic.
I have verified the fix for BitSetSArray and OptionalArray.
I did not include tests for RaggedArray and ACompressedArray. After looking at the implementations, I am convinced they are not thread-safe, but I was not able to create unit tests to show that specific behaviour.
Thank you for your analysis and contribution @yj-40-56. It's good to know that you identified OptionalArray, BitSetArray, RaggedArray, and CompressedArray as array types that may require locking. I think it would be safer to allow a whitelist of array types to bypass locking (also for future proofing). I'll leave the PR open to fix some formatting issues and revisit some aspects that could be done more efficiently. Good luck in your exam!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Student project for DIA at TU Berlin: improving copy()