Parallel read and write operation not working

@simonbasle But there is a decrease in the performance. Anyway, I am able to run the programs in parallel in perform both the operations simultaneously now after the suggested change. Maybe I should spawn another thread which tries to get the keys in parallel to that of the threads that are trying to read the documents. That might improve the performance, but it wouldn’t answer why after changing from Stale.FALSE to Stale.TRUE there is a dip in the performance.