[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2019-01-30 Thread Manjusaka
Manjusaka added the comment: ping -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Manjusaka
Manjusaka added the comment: > `selectors` makes underlying implementations irrelavant to most users since > we can simply use `DefaultSelector` I agree with this. > If you know you want to add EPOLL_EXCLUSIVE, why not just use `select.epoll`? I don't think so. If I use the `select`

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Xiang Zhang
Xiang Zhang added the comment: > I don't think to make selector be a public property is a good idea. It will > break the whole system integrity. If exposing a private property is not a good idea, another choice may be construct a selector with a customized I/O multiplexer, adding an

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Manjusaka
Change by Manjusaka : -- nosy: -asvetlov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Andrew Svetlov
Andrew Svetlov added the comment: Hmm, I forgot kqueue usage details: it operated not only with int flags but more complex structures. Giampaolo, thanks for pointing on! Please let me sleep on it. -- ___ Python tracker

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Manjusaka
Manjusaka added the comment: Actually, in my implementation, it also supports POLL with the different event. I don't think to make selector be a public property is a good idea. It will break the whole system integrity. Please think about it, if people want to use epoll/poll with some

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I took a look at your PR. As the PR currently stands it only works with epoll() selector. For the other selectors this is just an extra argument which does nothing, so it complicates the API of 2 methods for no real gain. Also, a single argument is not

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread STINNER Victor
STINNER Victor added the comment: I mean that using extra_events to get access to EPOLLEXCLUSIVE, there is no need later to add a new parameter for select.EPOLLONESHOT: it would be "future proof"! -- ___ Python tracker

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Manjusaka
Manjusaka added the comment: Vicor: > Moreover, we directly support any EPOLL constant exposed in the select > module. No need to change the API. I don't think so In class _PollLikeSelector ,here's register method def register(self, fileobj, events, data=None): key =

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Manjusaka
Manjusaka added the comment: OK, I will change my code -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread STINNER Victor
STINNER Victor added the comment: I prefer Giampaolo since discussed flags are very specific to epoll(): select() doesn't support them for example, nor kqueue nor devpoll (not *yet*). If we add a keyword-parameter, to me, it sounds like it's something "portable" working on multiple

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Manjusaka
Manjusaka added the comment: In my opinion selectors is an abstract for select, so I don't think allow people use select.* in selector is a good idea. like this > s.register(fd, EVENT_READ, extra_events=select.EPOLLEXCLUSIVE | > select.EPOLLONESHOT) Because the multiple epoll's params

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I see. Then I would say it's a matter of deciding what's the best API to provide. Another possibility is to promote the underlying epoll() instance as a public property, so one can do: >>> s = selectors.EpollSelector() >>> s.register(fd, EVENT_READ) >>>

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Manjusaka
Change by Manjusaka : -- keywords: +patch pull_requests: +10433 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Manjusaka
Manjusaka added the comment: Hello rodola Here's detail: In the server, we use multiprocess to handle the request with share the same FD. OK, when a request comes, all the process wake up and try to accept the request but only one process will accept success and the others will raise an

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I'm not sure I understand what EPOLLEXCLUSIVE is about. Could you provide a use case? Also, there are other constants which may also be useful such as EPOLLWAKEUP and EPOLLONESHOT: http://man7.org/linux/man-pages/man2/epoll_ctl.2.html So perhaps it makes

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Manjusaka
Manjusaka added the comment: "a keyword-only parameter" is good I'll take it done -- ___ Python tracker ___ ___ Python-bugs-list

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Manjusaka
Manjusaka added the comment: I will work on a PR -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread STINNER Victor
STINNER Victor added the comment: if exclusive and hasattr(select, "EPOLLEXCLUSIVE"): epoll_events |= select.EPOLLEXCLUSIVE Maybe NotImplementedError would be more appropriate rather than silently ignore the error? -- ___

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread STINNER Victor
STINNER Victor added the comment: EPOLLEXCLUSIVE doc from Linux manual page: """ EPOLLEXCLUSIVE (since Linux 4.5) Sets an exclusive wakeup mode for the epoll file descriptor that is being attached to the target file descriptor, fd. When a wakeup event occurs and multiple epoll file

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread STINNER Victor
STINNER Victor added the comment: > Add a keyword argument for selector.EpollSelector with default value. I suggest to use a keyword-only parameter: def register(self, fileobj, events, data=None, *, exclusive=False): Do you want to work on a pull request? -- nosy: