two-phase synchronization via gevent.queue.join to determine generation end