def __init__(self, nworkers, name="Pool"):
        """
        \param nworkers (integer) number of worker threads to start
        \param name (string) prefix for the worker threads' name
        """
        self._workq   = Queue.Queue()
        self._closed  = False
        self._workers = []
        for idx in xrange(nworkers):
            thr = PoolWorker(self._workq, name="Worker-%s-%d" % (name, idx))
            try:
                thr.start()
            except:
                # If one thread has a problem, undo everything
                self.terminate()
                raise
            else:
                self._workers.append(thr)

        \param nworkers (integer) number of worker threads to start
        \param name (string) prefix for the worker threads' name
        
recipes/Python/576519_Thread_pool_same_API/recipe-576519.py