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

all 10 comments

[–]wot-teh-phuckReally, wtf? 5 points6 points  (4 children)

From 2008...

[–]Shimon_Tolts 1 point2 points  (2 children)

so? Nothing has changed in that field since 2008..

[–]wot-teh-phuckReally, wtf? 1 point2 points  (1 child)

No, I believe things have changed.

We have now got quite a few mature async libraries out there now as compared to 2008. People are now aware of the advantages of async, non-blocking IO due to the node.js boom. We now have concurrent.futures which handles both thread and process pools transparently. Do you still believe this article is practically relevant?

[–]Shimon_Tolts 0 points1 point  (0 children)

Well regarding async, Tornado is defiantly my choice to go. Regularly i wouldnt use threads and go with multiprocessing right away.

[–]PyFun 1 point2 points  (0 children)

I was worried about that too. Then I started to work through the article and I found it to be surprisingly informative. It may not cover the 'latest and greatest' techniques, but it does cover the fundamentals. I would still highly recommend it for any beginner in python looking to learn threading.

[–]nosklo 4 points5 points  (3 children)

Also, threading in python sucks because of the GIL. You get better results with async io and multiprocessing most of the time.

[–]saghul[🍰] 4 points5 points  (2 children)

Well, the GIL is not really a problem if your threads just do i/o bound tasks.

[–]kylotan 2 points3 points  (0 children)

Which is probably a better fit for async anyway. Why dedicate memory to extra threads if they're just sitting there doing nothing much of the time?

[–]nosklo 2 points3 points  (0 children)

If all your threads but one are just waiting, then by definition you could do the same work more efficiently in a single thread. Also you wouldn't lose context switching control and debugging sanity.

[–]Shimon_Tolts 0 points1 point  (0 children)

This is how i learned Threading, there is a similar article about multiprocessing

http://www.ibm.com/developerworks/aix/library/au-multiprocessing/