Re: Multithreaded class with queues
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: Multithreaded class with queues

From: Aahz <aahz@pythoncraft.com>
Date: Fri Jul 29 2005 - 05:24:09 CEST

In article <mailman.2037.1122027168.10512.python-list@python.org>,
Antal Rutz <arutz@mimoza.pantel.net> wrote:
>
>I wrote a little class to make multihreading easier. It's based on one
>of aahz's threading example scripts. What it does:

Thanks!

>It spawns up number of CollectorThreads and one ProcessThread. The
>CollectorThreads listen on one queue (inputqueue), read, process the
>data (with colfunc), put the result onto the outputqueue. The
>ProcessThread listens on the outputqueue, reads, processes (with
>prfunc). end. (more details in the attached file)
>
>it seems to work with test functions but when I use a network-intensive
>function (snmp-queries) it just gets slower with maxThreads set to more
>than 1.

Hrm. There's nothing obviously wrong. What happens if you use it as a
spider?

-- 
Aahz (aahz@pythoncraft.com)           <*>         http://www.pythoncraft.com/
The way to build large Python applications is to componentize and
loosely-couple the hell out of everything.
Received on Thu Sep 29 17:13:35 2005