Live data from Hacker News

Thread pools: How do I use them?

jvns.ca

1–10 of 48 posts

Re: Thread pools: How do I use them?

#5

I like the style of writing in this post. Its fresh in the programming world where everyone seems to know it all for someone to admit something is hard or confusing.

Heck yea. Im kind of new here and it can be so intimidating. I feel like everyone is an expert at everything.

Re: Thread pools: How do I use them?

#6

I like the style of writing in this post. Its fresh in the programming world where everyone seems to know it all for someone to admit something is hard or confusing.

All of the posts on this blog are like this, so you should read the archives, for sure. I agree completely.

Re: Thread pools: How do I use them?

#8
post #4

Maybe "Scala concurrency surprises" would be a better title.

It uses the JVM's threadpools directly so it applies to more or less any JVM-based language, and the problems it talks about (expensive sequential operation before threadpool submission and unbounded threadpool queue) are pretty common issues.

Witness the unbounded and unconfigurable (though replaceable — at your own risk since you're setting a "private" variable of the pool) queue of Python 3's threadpool: https://hg.python.org/cpython/file/default/Lib/concurrent/fu...

Re: Thread pools: How do I use them?

#9
> Here's what that looks like in Python.

Although python multithreading outside of IO tasks or dropping into C code that drops the GIL isn't going to parallelize, the latter of which is the only way you're going to burn up cores. The API does make it seem simple though.

Re: Thread pools: How do I use them?

#10
post #5

I like the style of writing in this post. Its fresh in the programming world where everyone seems to know it all for someone to admit something is hard or confusing.

Heck yea. Im kind of new here and it can be so intimidating. I feel like everyone is an expert at everything.

It's not that, it's just that experts tend to contribute to threads where they can share their expertise.

So while it appears that everyone here is amazing; that isn't the case: we just tend to have something that we're very good at and comment on it.

The good thing is that you can learn a lot here as long as you don't get sidelined by some of the inane arguments and fighting :)

Post reply on HN