def retrieve(result_queue, queue_size):
    """ Retrieve results from a shared queue.

    """
    results = []
    while queue_size:
        results.append(result_queue.get())
        queue_size -= 1
    return results