[Tutor] Threading

Kent Johnson kent37 at tds.net
Fri Sep 12 02:31:35 CEST 2008


On Thu, Sep 11, 2008 at 10:56 AM, Oleg Oltar <oltarasenko at gmail.com> wrote:
> Hi!
>
> I need to open about 1200 urls from my database. And to check that those
> urls are really exists.
>
> I used urllib2.urlopen for it. But it's a little bit slow. I thought that
> it's might be a good idea to do it in a threads. So it can add some
> performance to my code.
>
> Unfortunately I can't get started with the treading module.  There are no
> simple examples in the python docs. Not sure how to start.

There are some good examples of threading in the Python cookbook, or this one:
http://www.chrisarndt.de/projects/threadpool/

Kent


More information about the Tutor mailing list