35
35
def start_transfer(read_file_handle, data_size, write_file_handle=None,
37
37
"""Start the data transfer from the reader to the writer.
38
38
Reader writes to the pipe and the writer reads from the pipe. This means
39
39
that the total transfer time boils down to the slower of the read/write
40
40
and not the addition of the two times."""
41
45
# The pipe that acts as an intermediate store of data for reader to write
42
46
# to and writer to grab from.
43
47
thread_safe_pipe = io_util.ThreadSafePipe(QUEUE_BUFFER_SIZE, data_size)