<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div>Well no, not from <u>multiple</u> threads.</div><div>I have only two threads – one main thread, which is the Django framework, and one detached </div><div>thread for the reactor, as the reactor itself would be blocking Django.</div><div><br></div><div>All Adapters are in Django, and are reaching out to the one reactor in the thread without threading themselves.</div><div>Is this 'allowed' ?</div><div><br></div><div>Fabian</div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> Glyph Lefkowitz <<a href="mailto:glyph@twistedmatrix.com">glyph@twistedmatrix.com</a>><br><span style="font-weight:bold">Reply-To: </span> Twisted general discussion <<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>><br><span style="font-weight:bold">Date: </span> Mon, 19 Sep 2011 14:16:56 -0400<br><span style="font-weight:bold">To: </span> Twisted general discussion <<a href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>><br><span style="font-weight:bold">Subject: </span> Re: [Twisted-Python] Twisted-Python Digest, Vol 90, Issue 16<br></div><div><br></div><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 19, 2011, at 2:03 PM, Fabian Rothfuchs wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: monospace; ">The second important part was the wakeUp() call, which apparently triggers<br>the reactor<br>To end all blocking tasks.<br></span></span></blockquote></div><br><div>For the most part, you have got the right idea now, but this is a BIG flashing red light for me. wakeUp() shouldn't actually be a public method at all; its _only_ use is as part of the implementation of 'callFromThread'. You should never, ever call it, and if you do call it, it should appear to do nothing at all.</div><div><br></div><div>Are you making use of the reactor from multiple threads? This is not allowed, and will break horribly, although it can sometimes (briefly) be made to appear to work by calling wakeUp().</div><div><br></div><div>-glyph</div></div></div>_______________________________________________
Twisted-Python mailing list
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a>
</span></body></html>