'Run one iteration of the I/O monitor loop.
This will run all selectables who had input or output readiness
waiting for them.'

def _doSelectInThread(self, timeout):

    reads = self.reads
    writes = self.writes
    while 1:
        try:
            (r, w, ignored) = _select(reads.keys(), writes.keys(), [], timeout)
            break
        except ValueError:
            log.err()
            self._preenDescriptorsInThread()
        except TypeError:
            log.err()
            self._preenDescriptorsInThread()
        except (select.error, IOError) as se:
            if (se.args[0] in (0, 2)):
                if ((not reads) and (not writes)):
                    return
                else:
                    raise
            elif (se.args[0] == EINTR):
                return
            elif (se.args[0] == EBADF):
                self._preenDescriptorsInThread()
            else:
                raise
    self._sendToMain('Notify', r, w)
