Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #25023
| From | Damjan <gdamjan@gmail.com> |
|---|---|
| Subject | Re: why greenlet, gevent or the stackless are needed? |
| Date | 2012-07-07 17:38 +0200 |
| References | <456501fb-af2d-4741-9b73-33c65d7f0aa8@t1g2000pbl.googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1893.1341675491.4697.python-list@python.org> (permalink) |
On 07.07.2012 09:09, self.python wrote: > (I'm very new to this coroutine part > so It's not supposed to attack these modules, > just I don't know the differences) > > atfer version 2.5, python officially support coroutine with yield. > and then, why greenlet, gevent, Stackless python are still useful? > > it there somthing that "yield" can't do > or just it is easier or powerful? The greenlet site has some very simple examples what it can provide. For example jumping from one function in another, and back http://greenlet.readthedocs.org/en/latest/index.html Gevent then uses greenlet to do lightweight "processes" (greenlets) that are I/O scheduled. This allows for a simple model of programming that scales to a large number of concurrent connections. You could do that with threads but you can't start as many threads as greenlets, since they have a much larger memory address space footprint. There's one function, called the gevent hub, that waits for any I/O event and then switches to the function that "blocked" on that I/O. -- damjan
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
why greenlet, gevent or the stackless are needed? "self.python" <howmuchistoday@gmail.com> - 2012-07-07 00:09 -0700
Re: why greenlet, gevent or the stackless are needed? Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-07-07 03:33 -0400
Re: why greenlet, gevent or the stackless are needed? "self.python" <howmuchistoday@gmail.com> - 2012-07-07 01:29 -0700
Re: why greenlet, gevent or the stackless are needed? "self.python" <howmuchistoday@gmail.com> - 2012-07-07 01:29 -0700
Re: why greenlet, gevent or the stackless are needed? Damjan <gdamjan@gmail.com> - 2012-07-07 17:38 +0200
csiph-web