[issue1657] [patch] epoll and kqueue wrappers for the select module
A.M. Kuchling li...@amk.ca added the comment: What exactly needs to be finished in the documentation? There are sections for the epoll and kqueue objects, and the epoll section looks fine, if brief. Is the problem that the kqueue section says things like 'filter-specific data' with no explanation? -- nosy: +akuchling ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1657 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Erik Gorset e...@gorset.no added the comment: The kqueue implementation is not working. It has a silly bug: - chl[i] = ((kqueue_event_Object *)ei)-e; + chl[i++] = ((kqueue_event_Object *)ei)-e; I've created issue 5910 and included a patch, which also adds another test case. Anything else I need to do to get the patch accepted? -- nosy: +Erik Gorset ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1657 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Changes by intgr ma...@juffo.org: -- nosy: +intgr ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1657 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Guido van Rossum [EMAIL PROTECTED] added the comment: pyepoll for static names sounds fine (assuming you want some consistency). Given all the rave reviews, what are the chances that you'll be checking this in soon? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Christian Heimes [EMAIL PROTECTED] added the comment: Say Go and I'll check the patch in ASAP. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Guido van Rossum [EMAIL PROTECTED] added the comment: Go. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Christian Heimes [EMAIL PROTECTED] added the comment: I've applied the patch in r61722. TODO: finish the documentation, any help is appreciated -- components: +Documentation -Extension Modules resolution: - accepted __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Gregory P. Smith [EMAIL PROTECTED] added the comment: +1 trunk_select_epoll_kqueue9.patch looks good to me. style nit: I'd just use self.fail(error message) instead of raise AssertionError(error message) within unittests. regardless, both work so I don't care. :) -- nosy: +gregory.p.smith __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Jim Jewett [EMAIL PROTECTED] added the comment: Is pyepoll a good prefix? To me, it looks a lot like the _Py and Py reservered namespaces, but not quite... -- nosy: +jimjjewett __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Christian Heimes [EMAIL PROTECTED] added the comment: I had to use some kind of prefix to avoid naming collisions with the epoll_* functions for the epoll header file. pyepoll sounded reasonable to me. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Trent Nelson [EMAIL PROTECTED] added the comment: Patch applies cleanly on FreeBSD 6.2-STABLE and all tests pass. Can't comment on technical accuracy. -- nosy: +Trent.Nelson __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Thomas Herve added the comment: Is there a chance for this go in the first alpha? FWIW, I've tested it with twisted kqueue and epoll reactors, and didn't get any problems. There are still 2 typos in the patch: KQ_ADD is used 2 times in the docs instead of KQ_EV_ADD. Everything else looks good to me. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Christian Heimes added the comment: I love to get it into the next alpha but I don't have time to today. Can you take it to the mailing list and ask somebody to review and submit the patch? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Christian Heimes added the comment: I've updated the patch. The latest patch didn't contain the unit tests and it failed to apply cleanly, too. Added file: http://bugs.python.org/file9535/trunk_select_epoll_kqueue9.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Changes by Christian Heimes: Removed file: http://bugs.python.org/file9019/trunk_select_epoll_kqueue5.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Changes by Christian Heimes: Removed file: http://bugs.python.org/file9029/trunk_select_epoll_kqueue7.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Changes by Christian Heimes: Removed file: http://bugs.python.org/file9027/trunk_select_epoll_kqueue6.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Changes by Christian Heimes: Removed file: http://bugs.python.org/file9241/trunk_select_epoll_kqueue8.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Changes by Giampaolo Rodola': -- nosy: +giampaolo.rodola __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Christian Heimes added the comment: Yeah, it's a reasonable suggestion. I'm changing the code to seconds as positive float and None = blocking. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Changes by Christian Heimes: Added file: http://bugs.python.org/file9241/trunk_select_epoll_kqueue8.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Christian Heimes added the comment: Can somebody else review the patch? therve from the Twisted team has reviewed it but I like to get an opinion of another core developer. Guido seems to be too busy. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Guido van Rossum added the comment: Still haven't had the time (sorry!), but one comment: please don't specify timeouts in millisecond. We use seconds (floats if necessary) everywhere else in Python, regardless of the underlying data structure or resolution. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Christian Heimes added the comment: Guido, have you reviewed the patch and are you fine with it? -- components: +Extension Modules nosy: +gvanrossum __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Guido van Rossum added the comment: Not yet, I ran out of time. Can you hold on for another week? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Thomas Herve added the comment: You have to use sys.platform to get 'darwin', not os.name. The rest of the test seems good. I didn't spot the check of EEXIST in pyepoll_internal_ctl, I'm not sure it's a good idea. I understand it's for being able to only use register, but it's not the way it's meant to be used. At least, there should be a test for it. Your example in kqueue_queue_doc doesn't work: * it uses KQ_ADD instead of KQ_EV_ADD * on OS X, you can't use kqueue on stdin * it uses KQ_DELETE instead of KQ_EV_DELETE Maybe an example on an arbitrary fd would be better. FWIW, I would have prefer to review epoll wrapper first, then kqueue. Splitting functionalities makes it easier to review. But that will be great to have that in python :). __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Christian Heimes added the comment: I attached a patch with a more complete test of kqueue. It's not that great, but it's a thing. I've only tested on OS X, but it works. A small unit test is better than no unit test :) Regarding the ability of building an epoll object from a fd, it might be usefull in some corner cases, but that's not a priority. It should be trivial to add an epoll.fromfd() classmethod. exarkun looked at the patch and told me that there may be some threadsafety issues: for example, when calling epoll_wait, you use self-evs unprotected. It's not very important, but you may want to tell it in the documentation. I found an interesting article about epoll. It states that epoll_wait() is thread safe. Ready lists of two parallel threds never contain the same fd. http://lwn.net/Articles/224240/ It's easier to remove the buffer and allocate memory inside the wait() method than to add semaphores. It makes the code. As you started the rich comparison for kevent objects, it may be interesting to have full comparison (to sort list of events). It's not a high priority though. What do you suggest as sort criteria? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Thomas Herve added the comment: What do you suggest as sort criteria? The natural sort of the tuple you used for equality, I'd say. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Changes by Christian Heimes: Removed file: http://bugs.python.org/file9014/trunk_select_epoll_kqueue2.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Changes by Christian Heimes: Removed file: http://bugs.python.org/file9010/trunk_select_epoll_kqueue.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Changes by Christian Heimes: Removed file: http://bugs.python.org/file9017/trunk_select_epoll_kqueue3.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Thomas Herve added the comment: Here I go for kqueue: * the docstring of test_kqueue.py is wrong * the tests are a bit light. It would be good the have a test like test_control_and_wait in test_epoll. * the kqueue_queue_control (and the pyepoll_poll) are now completely wrong! You should not limit to FD_SETSIZE, these 2 systems are there because they're able to handle for fds than that. Also, this buffer thing looks like a premature optimization. I'm unable to tell if it's correct or not. * the NETDEV and related flags aren't defined under OS X 10.4. I guess there are flags for freebsd, but kqueue should build on OS X too. I've been able to use this module for the twisted reactor, so the functionality is OK. But thsi FD_SETSIZE limit is a huge problem. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Changes by Christian Heimes: Removed file: http://bugs.python.org/file9018/trunk_select_epoll_kqueue4.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Changes by Thomas Herve: Added file: http://bugs.python.org/file9020/test_kqueue.diff __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Thomas Herve added the comment: I attached a patch with a more complete test of kqueue. It's not that great, but it's a thing. I've only tested on OS X, but it works. Regarding the ability of building an epoll object from a fd, it might be usefull in some corner cases, but that's not a priority. exarkun looked at the patch and told me that there may be some threadsafety issues: for example, when calling epoll_wait, you use self-evs unprotected. It's not very important, but you may want to tell it in the documentation. As you started the rich comparison for kevent objects, it may be interesting to have full comparison (to sort list of events). It's not a high priority though. That's all for now! __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Changes by Christian Heimes: Removed file: http://bugs.python.org/file8999/trunk_select_epoll3.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Changes by Christian Heimes: Removed file: http://bugs.python.org/file9009/trunk_select_epoll_kqueue.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Changes by Christian Heimes: Added file: http://bugs.python.org/file9010/trunk_select_epoll_kqueue.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Thomas Herve added the comment: Some remarks: * the name of the function used for PyArg_ParseTupleAndKeywords in register, modify, unregister is set to control instead of the good name. * there is a leak in pyepoll_new if the parsing of arguments fails. * the indentation is sometimes tabs, sometimes spaces. That should be good to unify this (to tabs I guess, since the select module used tabs before). * it seems there is an unrelated change in sunau.py * I don't think the stdlib unittest module has skip support. You have to find another way to skip the tests if the modules aren't present. I've been able to port the epollreactor to your implementation and run the whole twisted tests with it, so I don't think there are outstanding problems. The code is fairly simple anyway. That's it for epoll and general remarks. I'll look at kqueue asap. Thanks! __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1657] [patch] epoll and kqueue wrappers for the select module
Christian Heimes added the comment: Some remarks: * the name of the function used for PyArg_ParseTupleAndKeywords in register, modify, unregister is set to control instead of the good name. Fixed * there is a leak in pyepoll_new if the parsing of arguments fails. Fixed * the indentation is sometimes tabs, sometimes spaces. That should be good to unify this (to tabs I guess, since the select module used tabs before). Fixed except for switch() and goto. I find the 4 space indention of the case and the goto lables easier to read. * it seems there is an unrelated change in sunau.py Fixed * I don't think the stdlib unittest module has skip support. You have to find another way to skip the tests if the modules aren't present. Fixed ;) I've been able to port the epollreactor to your implementation and run the whole twisted tests with it, so I don't think there are outstanding problems. The code is fairly simple anyway. That's it for epoll and general remarks. I'll look at kqueue asap. Thanks! Thansk for the code review and your remarks. I've fixed the problems locally. I've also fixed a problem in unregister when fd is already closed and I'm using PyFile_AsFileDescriptor(). It supports ints and objects with a fileno() method. I'm waiting for your test of kqueue before I upload the patch. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1657 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com