yj-40-56 commented on PR #2399:
URL: https://github.com/apache/systemds/pull/2399#issuecomment-3814017427

   Replaced Locking on ValueType.BOOLEAN with locking based on ArrayType:
   
   - BitSetArray requires locking due to underlying storage in longs. Small 
Array<Boolean> 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. 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to