<html><body><br />On 05:39 pm, andrewfr_ice@yahoo.com wrote:<br /><br />>(When I have time, I will write a proper reactor. This<br />>should be a little more than overriding the<br />>doIteration() method of selectReactor). Or re-read the<br />>Blocking demo : I don't quite understand how it works)<br /><br />I've said it before and I'll say it again.  Writing a reactor is the _wrong_ way to attempt to integrate Twisted and stackless.  Reactors are implemented to implement operating system or platform multiplexing technologies, and stackless does not have its own multiplexor.  Multiplexing technologies are things like kqueue, epoll, IOCP, WaitForMultipleObjects, and AIO: APIs that allow you to wait for multiple input/output sources (including the clock) at the same time.<br /><br />The issue is confused somewhat by GUI toolkits, which have their own event loops that wrap these APIs, so we have a few things that use those reactors as a back-end to cooperate in the most friendly way possible with those GUIs, but ultimately what Twisted is talking to in GUI libraries is another multiplexing API.<br /><br />Stackless does not have any such API, and nor should it.  Making a stackless reactor would needlessly couple stackless/twisted integration to a particular multiplexor.  For example, it would make it impossible to write an application which used both GTK and Stackless.  Also, you'd need to choose either a portable, but inefficient and non-scalable API (like select) or a highly performant, but highly platform-specific API (like kqueue).  This is a decision that should be made when an application is deployed, and only required by an application developer if they are using platform-specific features (which stackless is not).<br /><br />I keep hearing this idea of a "stackless reactor" bandied about, and I don't know how I can make this any more clear.  Again I refer to my original post on the subject:<br /><br />    http://article.gmane.org/gmane.comp.python.twisted/13946<br /><br />>1) Eliminate a OS-Thread (both Stackless and Twisted<br />>folks concur that this is wrong, wrong, wrong).<br /><br />Notwithstanding the above, I'm glad that you've eliminated this.  It's a step in the right direction.<br /></body></html>