Use select instead of threads

Issue #38 invalid
Flozza created an issue

The initial idea was that the client should run under both Windows and Linux but the past has shown that they are only run under Linux anyway and most of the times we have additional machines available running Ubuntu.

Since Windows cannot use select on file descriptors (such as the stdout and stderr used for the exploits), we opted to start a thread per exploit. This is far less efficient and produces a huge overhead.

The far better solution is to drop Windows support and use select. Then we don't start a thread for each process but rather get a list of processes that have readable data on stdout and/or stderr. We read data from all these, process as necessary and then do our usual management of running processes.

Note: Before using select we should also evaluate the other options, e.g. epoll, poll, etc. and see what suits best here.

Comments (1)

  1. Log in to comment