I have many gzipped files which contain records that I am trying to sequence into a single consolidated file. CPU power is not a constraint.
I want to spin up threads that read from GZipInputStreams as necessary. The amount that will be read from each file at any given time is variant and unpredictable. The most obvious way to solve this problem is to have a thread pool where a task is submitted to read from a GZipInputStream if a backing buffer falls below a low watermark.
I am concerned that reading from a single GZipInputStream from different threads could manifest a memory barrier issue since it may have been assumed that data would be consumed from only one thread.
To be clear, I am not suggesting that more than one thread will read from the same GZipInputStream concurrently, but rather the lack of synchronization monitors may cause some data to be inconsistent if the stream is read from one thread and then immediately read from another thread.