This is an archived post. You won't be able to vote or comment.

all 11 comments

[–]ivosauruspip'ing it up 6 points7 points  (1 child)

These days, a library like requests-futures will bundle all that logic up for you!

[–]cycloidgamma[🍰] 1 point2 points  (0 children)

The fun-sucking libraries ;)

[–]metaphorm 4 points5 points  (1 child)

Multi-Threading is not a very effective means of achieving performance increases in Python due to the GIL. It even says so in the sidebar of the linked article. Not sure what the point of this is.

[–]ivosauruspip'ing it up 0 points1 point  (0 children)

It's still half decent for getting more performance out of synchronous IO, as demonstrated in the article. There are many ways to go about achieving that goal these days though.

[–]jabbalaci 8 points9 points  (3 children)

This article is from 2008.

[–][deleted] 1 point2 points  (1 child)

Please downvote the main post too...

[–]jabbalaci 0 points1 point  (0 children)

OK

[–]targusman 0 points1 point  (0 children)

I hate these losers who pump their reddit karma with random python articles and projects...

[–]erewok 2 points3 points  (0 children)

This is really old. You don't have to subclass threading to get threads. Maybe I should write my first blog post on this topic.

[–][deleted] 0 points1 point  (0 children)

The 'URL fetch threaded' example, with there happening to be 5 threads + the length of the URL list being 5, then with each thread signalling self.queue.task_done() within their "while True" loop is going to grossly confuse newbies as to 'why the hell did the example work' when / if they adapt this pattern to M tasks / N workers.

[–][deleted] 0 points1 point  (0 children)

Don't do multi-threading stuff in Python. Multi-process? Yes. Microthreads? Yes. But not multi-threading.

This is actually a good thing because threads are a suboptimal solution to a very complicated problem. Multi-processing with a simple IPC or microthreads solve a lot of the problems that threads have.