do both reads and writes in separate threads to enable timeouts to be caught and processing to continue.
use multiprocessing pool to combine results