<html><body><br />On 05:39 pm, andrewfr_ice@yahoo.com wrote:<br /><br />&gt;(When I have time, I will write a proper reactor. This<br />&gt;should be a little more than overriding the<br />&gt;doIteration() method of selectReactor). Or re-read the<br />&gt;Blocking demo : I don't quite understand how it works)<br /><br />I've said it before and I'll say it again. &#160;Writing a reactor is the _wrong_ way to attempt to integrate Twisted and stackless. &#160;Reactors are implemented to implement operating system or platform multiplexing technologies, and stackless does not have its own multiplexor. &#160;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. &#160;Making a stackless reactor would needlessly couple stackless/twisted integration to a particular multiplexor. &#160;For example, it would make it impossible to write an application which used both GTK and Stackless. &#160;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). &#160;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. &#160;Again I refer to my original post on the subject:<br /><br />&#160; &#160; http://article.gmane.org/gmane.comp.python.twisted/13946<br /><br />&gt;1) Eliminate a OS-Thread (both Stackless and Twisted<br />&gt;folks concur that this is wrong, wrong, wrong).<br /><br />Notwithstanding the above, I'm glad that you've eliminated this. &#160;It's a step in the right direction.<br /></body></html>