Exemplo n.º 1
0
 def terminate_idle_children(self):
     for slot, idle in enumerate(self._idle):
         pid = self._pids[slot]
         if idle:
             print '==> Killing idle pid {}'.format(pid)
             kill(pid, signal.SIGKILL)
             #os.waitpid(pid, 0)  # necessary?
         else:
             print '==> Waiting for pid {} (still busy)'.format(pid)
Exemplo n.º 2
0
 def terminate_idle_children(self):
     for slot, idle in enumerate(self._idle):
         pid = self._pids[slot]
         if idle:
             print '==> Killing idle pid {}'.format(pid)
             kill(pid, signal.SIGKILL)
             #os.waitpid(pid, 0)  # necessary?
         else:
             print '==> Waiting for pid {} (still busy)'.format(pid)
Exemplo n.º 3
0
    def kill_children(self):
        """
        Force-kill all children.  This function should block until all
        children are terminated.
        """
        # As soon as we can acquire all slots, we're done executing
        for pid in self._pids:
            if pid != 0:
                print 'killing pid %d...' % (pid,)
                kill(pid, signal.SIGKILL)

        self.wait_for_children()
Exemplo n.º 4
0
    def kill_children(self):
        """
        Force-kill all children.  This function should block until all
        children are terminated.
        """
        # As soon as we can acquire all slots, we're done executing
        for pid in self._pids:
            if pid != 0:
                print 'killing pid %d...' % (pid, )
                kill(pid, signal.SIGKILL)

        self.wait_for_children()