Re: [python-tulip] A mix of zip and select to iterate over multiple asynchronous iterator ?

2016-04-19 Thread Guido van Rossum
Yes, asynczip() sounds like a nice abstraction if you already have two async-iterable streams. Perhaps it makes sense to add it to aiohttp, or to release it as a separate PyPI package first. On Tue, Apr 19, 2016 at 8:53 AM, Julien Palard wrote: > o/ > > On 04/18/2016 05:31

Re: [python-tulip] Process + Threads + asyncio... has sense?

2016-04-19 Thread Imran Geriskovan
> This is a very simple example, but it illustrates some of the problems with > threading vs coroutines: >1. With threads you need more locks, and the more locks you have: a) the > lower the performance, and b) the greater the risk of introducing > deadlocks; > So please keep in mind that

Re: [python-tulip] Process + Threads + asyncio... has sense?

2016-04-19 Thread Tobias Oberstein
Sorry, I should have been more explicit: With Python (both CPython and PyPy), the least overhead / best performance (throughput) approach to network servers is: Use a multi-process architecture with shared listening ports (Linux SO_REUSEPORT), with each process running an event loop

Re: [python-tulip] Process + Threads + asyncio... has sense?

2016-04-19 Thread Tobias Oberstein
Am 19.04.2016 um 23:02 schrieb Imran Geriskovan: A) Python threads are not real threads. It multiplexes "Python Threads" on a single OS thread. (Guido, can you correct me if I'm wrong, and can you provide some info on multiplexing/context switching of "Python Threads"?) Sorry, you are wrong.

Re: [python-tulip] Process + Threads + asyncio... has sense?

2016-04-19 Thread Gustavo Carneiro
On 19 April 2016 at 22:02, Imran Geriskovan wrote: > >> A) Python threads are not real threads. It multiplexes "Python Threads" > >> on a single OS thread. (Guido, can you correct me if I'm wrong, > >> and can you provide some info on multiplexing/context switching of