-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
epoll and kqueue wrappers for the select module #45998
Comments
UPDATE:
|
Cool, thanks for working on that. Just for the record, I don't really For this patch, I don't see the benefit of putting it in the select Looking at the code, I don't have many remarks. pyepoll_new may leak if Thanks again for working on it. |
There is at least one, but probably several other modules named "epoll" The select module already contains an interface to select and poll. IMO
Thanks, I've fixed the problem in pyepoll_new. The Linux kernel protects every call to epoll_ctl with a mutex. It |
I mistakenly removed the wrong message. Here is the original msg: The patch implements Linux's epoll interface My interface is almost identical to Twisted's API except for some names. Missing: |
Added license header to test_epoll. |
First draft of a kqueue wrapper loosely based on Twisted's _kqueue.c |
UPDATE:
|
Some remarks:
I've been able to port the epollreactor to your implementation and run That's it for epoll and general remarks. I'll look at kqueue asap. Thanks! |
Fixed
Fixed
Fixed except for switch() and goto. I find the 4 space indention of the
Fixed
Fixed ;)
Thansk for the code review and your remarks. I've fixed the problems I'm waiting for your test of kqueue before I upload the patch. |
Here is the promised patch. I've added a small optimization. The objects |
I've fixed a bug with the preallocated buffer and in the repr() of kevent. |
Here I go for kqueue:
I've been able to use this module for the twisted reactor, so the |
Fixed
Does Twisted have additional tests? I agree that the tests are too light
I've seen the limitation in an example somewhere. I've read the specs
I'm using FreeBSD to test the kqueue interface. I can't tell if it's The new patch replaces the FD_SETSIZE limitation and adds a richcompare |
I attached a patch with a more complete test of kqueue. It's not that Regarding the ability of building an epoll object from a fd, it might be exarkun looked at the patch and told me that there may be some As you started the rich comparison for kevent objects, it may be That's all for now! |
A small unit test is better than no unit test :)
It should be trivial to add an epoll.fromfd() classmethod.
I found an interesting article about epoll. It states that epoll_wait()
What do you suggest as sort criteria? |
The natural sort of the tuple you used for equality, I'd say. |
I had some trouble with your patch. BSD doesn't raise a socket error The new patch removes the preallocated buffer and adds fromfd() class |
You have to use sys.platform to get 'darwin', not os.name. The rest of I didn't spot the check of EEXIST in pyepoll_internal_ctl, I'm not sure Your example in kqueue_queue_doc doesn't work:
FWIW, I would have prefer to review epoll wrapper first, then kqueue. |
UPDATE:
|
Guido, have you reviewed the patch and are you fine with it? |
Not yet, I ran out of time. Can you hold on for another week? |
Can somebody else review the patch? therve from the Twisted team has |
Still haven't had the time (sorry!), but one comment: please don't |
Yeah, it's a reasonable suggestion. I'm changing the code to seconds as |
I've updated the patch. The latest patch didn't contain the unit tests |
Is there a chance for this go in the first alpha? FWIW, I've tested it There are still 2 typos in the patch: KQ_ADD is used 2 times in the docs |
I love to get it into the next alpha but I don't have time to today. Can |
Patch applies cleanly on FreeBSD 6.2-STABLE and all tests pass. Can't |
+1 trunk_select_epoll_kqueue9.patch looks good to me. style nit: I'd just use self.fail("error message") instead of raise |
Is pyepoll a good prefix? To me, it looks a lot like the _Py and Py |
I had to use some kind of prefix to avoid naming collisions with the |
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 |
Say "Go" and I'll check the patch in ASAP. |
Go. |
I've applied the patch in r61722. TODO: finish the documentation, any help is appreciated |
The kqueue implementation is not working. It has a silly bug:
+ chl[i++] = ((kqueue_event_Object *)ei)->e; I've created bpo-5910 and included a patch, which also adds another test |
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? |
"Is the problem that the kqueue section says things like 'filter-specific data' with no explanation?" The phase is not in the (newer) 3.1.2 docs. Given the absence of a specific doc issue, closing. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: