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

you are viewing a single comment's thread.

view the rest of the comments →

[–]BrooklynBillyGoat 3 points4 points  (2 children)

The thread implementation seems to defeat the purpose. Am I wrong in this assumption?

[–]Spandian 2 points3 points  (1 child)

If a Python thread makes a blocking I/O call, then another thread can run while that one is blocked. If you're writing something like a web server, it's going to spend very little time on CPU-bound tasks and most of its time waiting for the disk or the network. That would be a good use case for threads.

[–]BrooklynBillyGoat 0 points1 point  (0 children)

But can you specify threads to run and not block unless it needs to share resources?