Checking for exception thrown by the writer thread after each read call