[Twisted-Python] PATCH: setattr problem in ThreadAttr

Matthias Urlichs smurf at noris.de
Wed Nov 13 16:19:34 EST 2002


Glyph Lefkowitz:
> On Wed, 13 Nov 2002 21:19:59 +0100, "Matthias Urlichs" <smurf at noris.de> wrote:
> > Nobody seems to have used twisted.python.threadable.ThreadAttr recently..:
> Wow.  If it's _that_ rarely used, maybe the right thing to do is just to trash
> it.  Would this code be useful to you if it worked?
Personally, I woudn't need it. IMHO: if you use threads in Twisted, you do
it via the thread pool. That doesn't mesh at all with ThreadAttr. State is
usually carried in objects or procedure arguments, which don't need global
storage anyway.

I find myself more in immediate need of a queueing mechanism; the
quick-and-dirty solution seems to be to fork off two threads and to use a
bounded Python Queue. However, the continuous switching between the reader
(which blocks on the queue, therefore needs to be in its own thread) and
Twisted's main thread (which writes to the process-or-whatever that's
going to eventually consume the data) seems rather sub-optimal for
performance.  :-/

Matthias Urlichs     |     noris network AG     |     http://smurf.noris.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20021113/639e529a/attachment.pgp 

More information about the Twisted-Python mailing list