how to start thread by group?

sjdevnull at yahoo.com sjdevnull at yahoo.com
Mon Oct 13 15:47:16 EDT 2008


On Oct 13, 6:54 am, Lawrence D'Oliveiro <l... at geek-
central.gen.new_zealand> wrote:
> In message <mailman.2151.1223416240.3487.python-l... at python.org>, Gabriel
>
>
>
> Genellina wrote:
> > En Tue, 07 Oct 2008 13:25:01 -0300, Terry Reedy <tjre... at udel.edu>
> > escribió:
>
> >> Lawrence D'Oliveiro wrote:
>
> >>> In message <mailman.2088.1223354239.3487.python-l... at python.org>,
> >>> Gabriel Genellina wrote:
>
> >>>> Usually it's more efficient to create all the MAX_THREADS at once, and
> >>>> continuously feed them with tasks to be done.
>
> >>>  Given that the bottleneck is most likely to be the internet
> >>> connection, I'd say the "premature optimization is the root of all evil"
> >>> adage applies here.
>
> >> Feeding a fixed pool of worker threads with a Queue() is a standard
> >> design that is easy to understand and one the OP should learn.  Re-using
> >> tested code is certainly efficient of programmer time.
>
> > I'd like to add that debugging a program that continuously creates and
> > destroys threads is a real PITA.
>
> That's God trying to tell you to avoid threads altogether.

Especially in a case like this that's tailor made for a trivial state-
machine solution if you really want multiple connections.



More information about the Python-list mailing list