<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def initialize_tasks(self):
 """Load the input queue to capacity. Overfilling causes a deadlock when `queue.put` blocks when full, so further tasks are enqueued as results are returned. """

        # Add a poison pill to shutdown each process.
        self.tasks = chain(self.iterable, [POISON_PILL] * self.num_processes)
        for task in islice(self.tasks, Q_MAX_SIZE):
            log.debug('Putting %s on queue', task)
            self.task_queue.put(task)