<p>For logging could we look at implementing posix aio on platforms that support it? I would be willing to help code that.</p>
<p>Justin</p>
<div class="gmail_quote">On Jul 12, 2012 8:51 AM, <<a href="mailto:exarkun@twistedmatrix.com">exarkun@twistedmatrix.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 11:32 am, <a href="mailto:itamar@itamarst.org">itamar@itamarst.org</a> wrote:<br>
>On 07/12/2012 05:17 AM, Tristan Seligmann wrote:<br>
>>3) log observers should expect to be inovked in non-reactor threads,<br>
>>making this a Mantissa bug.<br>
>In theory this is the case - the logging howto says "The observer needs<br>
>to be thread safe if you anticipate using threads in your program." The<br>
>API docs don't mention threads, though..<br>
><br>
>In practice however, probably every custom observer gets this wrong, so<br>
>we really need some infrastructure to make this easier or to fix it.<br>
>Possibly we should have some way to indicate an observer is thread-<br>
>safe,<br>
>assume by default they are not, and if they are not wrap them in a<br>
>reactor.callFromThread wrapper.<br>
<br>
The logging system is already a bottleneck in some applications. Doing<br>
even more work to try to make it properly thread-safe will probably slow<br>
it down even more.<br>
<br>
I think it was a mistake to try to make it possible to use<br>
twisted.python.log free-threaded. I think we should think about getting<br>
rid of this claimed feature. Perhaps it could be replaced with a more<br>
explicit, probably more restricted, logging feature for non-reactor<br>
threads.<br>
<br>
Unless someone can magically fix the threading issues without hurting<br>
performance. Then, great, go for it.<br>
>I would also like some infrastructure to make the file log observer run<br>
>in its own thread, but that's almost the opposite use case :)<br>
<br>
Sure, but that's probably based on top of an asynchronous file I/O API<br>
that's not explicitly thread-based (but probably is thread-based in<br>
practice, because what other kind of asynchronous file I/O even exists).<br>
<br>
Also, to explicitly answer Tristan's question:<br>
<br>
It's a bug in the Mantissa log observer.<br>
<br>
Jean-Paul<br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</blockquote></div>