yandrey321 commented on PR #11102: URL: https://github.com/apache/ozone/pull/11102#issuecomment-5478986371
@taklwu what is the use case in Hbase for concurrent seek/read access to InputStream from multiple threads in Hbase, it seems like an error-prone implementation, lets assume that 2 threads are doing: Thread 1 1. seek(1000) - t1.1 2 read(1000) - t1.2 Thread 2 1. seek(0) - t2.1 2. read(100) t2.2 if they perform both perform operations without synchronizations between threads it can lead to the following execution sequence: 1. seek(1000) - t1.1 2. seek(0) - t2.1 3. read(1000) - t1.2 4. read(100) t2.2 And both threads would read data at the wrong offset. And its true for any client. So if client does internal synchronization between readers' treads, InputThread itself can remain non-thread safe. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
