Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 3
    Makes sense. Is ExecutorService Interface the best way to go about creating new threads in a web application? Commented Jun 12, 2013 at 13:30
  • 4
    @kapricanon: yes, unless you have some specific requirements it can't handle, or your web server already has something similar. Commented Jun 12, 2013 at 13:53
  • In the last para, when you said "... might be you need to access other network resources, e.g. call several different web services ..." - is creating a new thread for every webservice call the best possible way ? Or is there someother better way to handle calling multiple requests ? Thanks :) Commented May 14, 2021 at 16:28
  • 1
    @kaushalpranav: The alternative would be using an event-based API like Java's nio (like Netty does). And what does "best" or "better" mean? Event-based APIs tend to be able to handle more overall requests, but also less intuitive and thus more error prone. But this can change with different implementations and versions. Commented May 14, 2021 at 19:36