1

Help! Normally I Just create a new thread whenever I need to do more than one thing at a time, but infrastructure says I can't create more than a thousand threads. How can I do more than one thousand things of work then???

Ian Ownbey
  • 85
  • 4
  • 1
    ok i closed this as a duplicate of a question about java. but I don't think that's what you are asking about, so reopening. the general concept of using a threadpool still stands. – Nathan Hughes May 09 '19 at 15:42
  • 1
    instead of threads, you can use asynchronous activities like CompletableFutures, Akka or Df4j actors, Kotlin coroutines etc. You can create millions of them. – Alexei Kaigorodov May 09 '19 at 15:46
  • as @Alexei says there are a lot of options. it would probably help to add a tag for the technology you're using so you get relevant answers. – Nathan Hughes May 09 '19 at 15:48
  • 1
    Re, "I Just create a new thread whenever I need to..." That's not scalable (as you already know). You'll have to find a different way to solve your problem. I second Nathan Hughes's suggestion: Use a _[thread pool](https://en.wikipedia.org/wiki/Thread_pool)_ – Solomon Slow May 09 '19 at 16:42

0 Answers0