0

I know it is very basic question to ask, but really do not know too much. Is it possible to have more than one thread pool in a single java application.

Second when Singleton instance is created, can it be shared with application too. As I know about Once Singleton instance is created then they are accessible globally. What does mean exactly globally here.

keepmoving
  • 1,813
  • 8
  • 34
  • 74
  • http://stackoverflow.com/questions/26243422/is-having-a-single-threadpool-better-design-than-multiple-threadpools is related – scrappedcola Mar 19 '15 at 17:28

1 Answers1

1

Basically - as many as you need and no more.

You will need one thread pool for each process that requires its own pool.

For Process I mean mechanism that requires a differently configured pool. For example, if you are servicing network requests and managing some long calculations then you would use two different pools as the calculations would use the threads in a completely different pattern that the network requests pool would be used.

OldCurmudgeon
  • 64,482
  • 16
  • 119
  • 213