[issue19465] selectors: provide a helper to choose a selector using constraints

2014-02-11 Thread Guido van Rossum
Changes by Guido van Rossum : -- resolution: -> wont fix status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue19465] selectors: provide a helper to choose a selector using constraints

2014-02-11 Thread STINNER Victor
STINNER Victor added the comment: It looks you rejected my idea, so I'm in favor of just closing the issue. Do you agree? -- ___ Python tracker ___ _

[issue19465] selectors: provide a helper to choose a selector using constraints

2013-11-23 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- assignee: -> docs@python components: +Documentation nosy: +docs@python ___ Python tracker ___ ___ Pyth

[issue19465] selectors: provide a helper to choose a selector using constraints

2013-11-23 Thread Charles-François Natali
Charles-François Natali added the comment: > Antoine Pitrou added the comment: > > I think this is more of a documentation issue. People who don't want a new fd > can hardcode PollSelector (poll has been POSIX for a long time). That's also what I now think. I don't think that the use case is co

[issue19465] selectors: provide a helper to choose a selector using constraints

2013-11-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think this is more of a documentation issue. People who don't want a new fd can hardcode PollSelector (poll has been POSIX for a long time). -- nosy: +pitrou ___ Python tracker

[issue19465] selectors: provide a helper to choose a selector using constraints

2013-11-01 Thread Charles-François Natali
Charles-François Natali added the comment: Of course, when I have 300 connections to remote nodes, I use poll() to multiplex between them. But there are times when you can have a large number of threads running concurrently, and if many of them call e.g. subprocess.check_output() at the same tim

[issue19465] selectors: provide a helper to choose a selector using constraints

2013-11-01 Thread Guido van Rossum
Guido van Rossum added the comment: Hm. If you really are going to create 300 instances, you should probably use asyncio. Otherwise, how are you going to multiplex them? Create 300 threads each doing select() on 1 FD? That sounds like a poor architecture and I don't want to bend over backwards to

[issue19465] selectors: provide a helper to choose a selector using constraints

2013-11-01 Thread Charles-François Natali
Charles-François Natali added the comment: There are actually two reasons to choosing poll over epoll/kqueue (i.e. no extra FD): - it's a bit faster (1 syscall vs 3) - but more importantly - and that's the main reason I did it in telnetlib/multiprocessing/subprocess - sometimes, you really don't

[issue19465] selectors: provide a helper to choose a selector using constraints

2013-10-31 Thread STINNER Victor
STINNER Victor added the comment: > OK. Let's have a function to select a default selector. > Can you think of a better name for the parameter? Or > maybe there should be two functions? I prefer to leave the question to the author of the module, Charles-François :-) --

[issue19465] selectors: provide a helper to choose a selector using constraints

2013-10-31 Thread Guido van Rossum
Guido van Rossum added the comment: OK. Let's have a function to select a default selector. Can you think of a better name for the parameter? Or maybe there should be two functions? -- ___ Python tracker __

[issue19465] selectors: provide a helper to choose a selector using constraints

2013-10-31 Thread STINNER Victor
STINNER Victor added the comment: > It still seems to me that this is pretty atypical use of selectors I already implemented something similar to subprocess.Popen.communicate() when I was working on old Python versions without the timeout parameter of communicate(). http://ufwi.org/projects/ed

[issue19465] selectors: provide a helper to choose a selector using constraints

2013-10-31 Thread Guido van Rossum
Guido van Rossum added the comment: Hm... I'm trying to understand how you're using the selector in telnetlib.py (currently the only example outside asyncio). It seems you're always using it with a single file/object, which is always 'self' (which wraps a socket), except one place where you're al

[issue19465] selectors: provide a helper to choose a selector using constraints

2013-10-31 Thread STINNER Victor
STINNER Victor added the comment: > What's the use case for not wanting to use an extra FD? A selector may be used a few millisecond just to check if a socket is ready, and then destroyed. For such use case, select() is maybe enough (1 syscall). Epoll requires more system calls: create the epo

[issue19465] selectors: provide a helper to choose a selector using constraints

2013-10-31 Thread Guido van Rossum
Guido van Rossum added the comment: What's the use case for not wanting to use an extra FD? Nevertheless I'm fine with using a function to pick the default selector (but it requires some changes to asyncio too, which currently uses DefaultSelector). Something I would find useful would be a way

[issue19465] selectors: provide a helper to choose a selector using constraints

2013-10-31 Thread STINNER Victor
New submission from STINNER Victor: multiprocess, telnetlib (and subprocess in a near future, see #18923) use the following code to select the best selector: # poll/select have the advantage of not requiring any extra file descriptor, # contrarily to epoll/kqueue (also, they require a single sy