From http://stackoverflow.com/questions/19607136/reading-and-writing-as-parallel-tasks