[SYSTEMDS-3867] Safe Fast Frame Copy#2399
Conversation
|
Replaced Locking on ValueType.BOOLEAN with locking based on ArrayType:
Additional ArrayTypes that are locked:
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 |
|
Just to pitch in, the implementations are indeed not thread safe for some specific variations of calling. However, if the caller does not have overlapping ranges that it sets, it is perfectly safe for OptionalArrays. The BitSetArray was intentionally fixed by introducing the lock (as the @yj-40-56 is pointing out), however ideally we should (for good performance) avoid using the lock by aligning updates to the nearest 64 values, to allow full parallelism. The RaggedArray and the DDCArray/ACompressedArray are both not designed to be frequently updated, so should not be considered a valid copy target. A better design than the proposed would be to specialize each of the fundamental arrays to take from the Source arrays. We have primitives like: That allows very efficient cloning from another array into the current one. This should just be called in parallel across different input columns. |
Student project for DIA at TU Berlin: improving copy()