[Twisted-Python] Re: [Twisted-commits] r13334 - Make log.err and log.msg actually threadsafe, by executing them in the
On Tue, 2005-03-29 at 09:00 -0700, James Knight wrote:
Author: foom Date: Tue Mar 29 09:00:10 2005 New Revision: 13334
Modified: trunk/twisted/internet/posixbase.py trunk/twisted/python/log.py trunk/twisted/python/threadable.py Log: Make log.err and log.msg actually threadsafe, by executing them in the reactor-loop if not called from the main thread.
I talked to glyph about this at some point, and he thought that we shouldn't do this, if you want to make observers thread safe you should do so yourself. I'm not sure I agree with glyph, though.
Make log.err and log.msg actually threadsafe, by executing them in the reactor-loop if not called from the main thread.
I talked to glyph about this at some point, and he thought that we shouldn't do this, if you want to make observers thread safe you should do so yourself. I'm not sure I agree with glyph, though.
If you make them threadsafe by marshalling to the reactor, is correct ordering still guaranteed ? Thomas Dave/Dina : future TV today ! - http://www.davedina.org/ <-*- thomas (dot) apestaart (dot) org -*-> But you never lost your beauty Although you lost your hope And you made no mistake you couldn't wash away with liar's tears pouring down your face <-*- thomas (at) apestaart (dot) org -*-> URGent, best radio on the net - 24/7 ! - http://urgent.fm/
On Wed, 30 Mar 2005 11:55:03 +0200, Thomas Vander Stichele <thomas@apestaart.org> wrote:
Make log.err and log.msg actually threadsafe, by executing them in the reactor-loop if not called from the main thread.
I talked to glyph about this at some point, and he thought that we shouldn't do this, if you want to make observers thread safe you should do so yourself. I'm not sure I agree with glyph, though.
If you make them threadsafe by marshalling to the reactor, is correct ordering still guaranteed ?
Thomas
Calls to log.{msg,err} were already serialized, so I don't think any changes have been made to the order observers will be called with events. Another thing about the change, though, is that it makes Twisted even more broken on threadless platforms. *poke foom* Jp
On Wed, 30 Mar 2005 10:28:25 -0500, James Y Knight <foom@fuhm.net> wrote:
On Mar 30, 2005, at 8:14 AM, Jp Calderone wrote:
Another thing about the change, though, is that it makes Twisted even more broken on threadless platforms. *poke foom*
Oughtn't. isInIOThread always returns true if you haven't initialized threads yet.
James
Except when it raises an exception, instead. :) I started on a bunch of threadless fixes. Now that 2.0 is out the door it might be time to pull them back into trunk. The code is in /branches/exarkun/threadless/ if anyone wants to look/contribute. Jp
On Wed, Mar 30, 2005 at 03:51:03PM +0000, Jp Calderone wrote: [...]
I started on a bunch of threadless fixes. Now that 2.0 is out the door it might be time to pull them back into trunk. The code is in /branches/exarkun/threadless/ if anyone wants to look/contribute.
Would this benefit from using the dummy_thread/dummy_threading modules from Python 2.4? -Andrew.
On Thu, 31 Mar 2005 09:44:24 +1000, Andrew Bennetts <andrew-twisted@puzzling.org> wrote:
On Wed, Mar 30, 2005 at 03:51:03PM +0000, Jp Calderone wrote: [...]
I started on a bunch of threadless fixes. Now that 2.0 is out the door it might be time to pull them back into trunk. The code is in /branches/exarkun/threadless/ if anyone wants to look/contribute.
Would this benefit from using the dummy_thread/dummy_threading modules from Python 2.4?
-Andrew.
I don't think I understand the point of those modules. As far as I can tell they are almost never useful. For Twisted's main use (deferToThread), they definitely aren't. Even so, we still need to support 2.2 for a while. The branch I referred to mainly just disables functionality until the parts of Twisted that really don't care about threads work again. Jp
participants (5)
-
Andrew Bennetts
-
Itamar Shtull-Trauring
-
James Y Knight
-
Jp Calderone
-
Thomas Vander Stichele