Message173216
> select() other than being supported on all platforms has the advantage of
> being simple and quick to use (you just call it once by passing a set of fds
> and then you're done).
Do you mean at the C level? Wouldn't you just do
struct pollfd pfd = {fd, POLLIN, 0};
if (poll(&pfd, 1, timeout) < 0) {...}
ready = pfd.revents != 0;
That does not look any less simple and quick.
> on the other hand you introduce a considerable slowdown given the amount
> of operations involved and described above.
poll(), unlike select(), does not have to scan an fd_set (of 1024 bits?) so I would have expected it to be faster if anything.
At the python level creating a new poll object each time might indeed be slower, but one could always cache it on the queue object.
BTW, are there any non-Windows platforms which support multiprocessing but don't have poll()? (On Windows WaitForSingleObject() is used instead.) |
|
Date |
User |
Action |
Args |
2012-10-17 23:37:59 | sbt | set | recipients:
+ sbt, giampaolo.rodola, William.Edwards |
2012-10-17 23:37:59 | sbt | set | messageid: <1350517079.34.0.849920138537.issue16269@psf.upfronthosting.co.za> |
2012-10-17 23:37:59 | sbt | link | issue16269 messages |
2012-10-17 23:37:59 | sbt | create | |
|