Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(187)

#6397: Implementing Solaris "poll" in the "select" module

Can't Edit
Can't Publish+Mail
Start Review
Created:
1 year, 6 months ago by jcea
Modified:
1 year, 6 months ago
Reviewers:
pitrou, neologix
CC:
jcea, exarkun, AntoinePitrou, giampaolo.rodola, rosslagerwall, devnull_psf.upfronthosting.co.za, devnull_psf.upfronthosting.co.za, Charles-François Natali
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Patch Set 3 #

Patch Set 4 #

Patch Set 5 #

Patch Set 6 #

Total comments: 30

Patch Set 7 #

Patch Set 8 #

Total comments: 6

Patch Set 9 #

Patch Set 10 #

Patch Set 11 #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Doc/library/select.rst View 3 chunks +83 lines, -1 line 0 comments Download
Lib/test/test_devpoll.py View 4 5 6 7 8 9 10 1 chunk +94 lines, -0 lines 0 comments Download
Misc/NEWS View 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
Modules/selectmodule.c View 1 2 3 4 5 6 7 8 9 10 7 chunks +369 lines, -0 lines 7 comments Download
configure View 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -3 lines 0 comments Download
configure.in View 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -3 lines 0 comments Download
pyconfig.h.in View 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 9
AntoinePitrou
Here are some comments. I haven't tried your patch since I don't have a Solaris ...
1 year, 6 months ago #1
jcea
Thanks for the detailed review, Antoine. I just have a question: test_devpoll.py is actually a ...
1 year, 6 months ago #2
jcea
Pending to know if I must change the original "test_poll.py" code. http://bugs.python.org/review/6397/diff/3606/11277 File Modules/selectmodule.c (right): ...
1 year, 6 months ago #3
jcea
Please, check the new changeset, with all your feedback. Thanks!. http://bugs.python.org/review/6397/diff/3606/11276 File Lib/test/test_devpoll.py (right): http://bugs.python.org/review/6397/diff/3606/11276#newcode53 ...
1 year, 6 months ago #4
AntoinePitrou
Hi, On 2011/11/08 18:53:33, jcea wrote: > On 2011/11/08 15:20:39, AntoinePitrou wrote: > > Are ...
1 year, 6 months ago #5
AntoinePitrou
http://bugs.python.org/review/6397/diff/3615/11301 File Lib/test/test_devpoll.py (right): http://bugs.python.org/review/6397/diff/3615/11301#newcode77 Lib/test/test_devpoll.py:77: pollster.poll(-2) Isn't this supposed to block? Or does it ...
1 year, 6 months ago #6
jcea
On 2011/11/08 23:13:22, AntoinePitrou wrote: > Hi, > > On 2011/11/08 18:53:33, jcea wrote: > ...
1 year, 6 months ago #7
jcea
Please review next changeset. Thanks for your time and your feedback! http://bugs.python.org/review/6397/diff/3615/11301 File Lib/test/test_devpoll.py (right): ...
1 year, 6 months ago #8
neologix_free.fr
1 year, 6 months ago #9
A little late...

http://bugs.python.org/review/6397/diff/3645/11417
File Modules/selectmodule.c (right):

http://bugs.python.org/review/6397/diff/3645/11417#newcode674
Modules/selectmodule.c:674: if (!self->n_fds) return 0;
Just a nit, but the usual coding style is to have return on its own line, and I
personally find (self->n_fds == 0) more clear.

http://bugs.python.org/review/6397/diff/3645/11417#newcode676
Modules/selectmodule.c:676: size = sizeof(struct pollfd)*self->n_fds;
A space around '*' would be welcome here.

http://bugs.python.org/review/6397/diff/3645/11417#newcode770
Modules/selectmodule.c:770: {
You're duplicating what's done in internal_devpoll_register(): instead of
`remove`, it could take a simple integer flag indicating what to do (i.e. add,
remove or modify).

http://bugs.python.org/review/6397/diff/3645/11417#newcode789
Modules/selectmodule.c:789: "poll( [timeout] ) -> list of (fd, event)
2-tuples\n\n\
You should probably make it clear that timeout is in milliseconds (and another
nit, but I don't think we usually place spaces around ] and ).

http://bugs.python.org/review/6397/diff/3645/11417#newcode851
Modules/selectmodule.c:851: return NULL;
Since you return, you don't need the else: this saves an indentation level (but
it's a question of style :-).

http://bugs.python.org/review/6397/diff/3645/11417#newcode854
Modules/selectmodule.c:854: num1 = PyLong_FromLong(self->fds[i].fd);
`num1` and `num2` aren't clear: something like `fd` and `event_mask` would be
better.

http://bugs.python.org/review/6397/diff/3645/11417#newcode906
Modules/selectmodule.c:906: */
I doubt getrlimit makes a blocking syscall: you could get it out of the
Py_BEGIN_ALLOW_THREADS (and the error condition could be right after the call).
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7