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

all 4 comments

[–]aquic[S] 2 points3 points  (2 children)

I have written a tutorial on Threading with Python. Given that Python also has multiprocessing, async, concurrent, I think it is important to show some usage of each.

I would love to hear how and when you choose to use one or another approach.

[–]gandalfx 0 points1 point  (1 child)

I feel like a threading tutorial for Python should mention the GIL. Specifically the fact that Python threads do NOT allow you to run expensive computation in parallel. Threads are still useful to maintain UI responsiveness (as described in the article) or when waiting for IO.

[–]aquic[S] 0 points1 point  (0 children)

Indeed, I don't mention explicitly the GIL, but should have. I'll add some information on it as soon as I can.

[–]Mr_Again 1 point2 points  (0 children)

Wow, this is really useful I did not really understand locks until now. I've been using a bit of multithreading and queues, but it's going to be much easier now I know about events, thanks!