I have a Multithreading application, so I implemented ExecutorService
with a Pool Size of 5 Threads
public class SimpleThreadPool {
public static void main(String[] args) {
ExecutorService executor = Executors.newFixedThreadPool(5);
for (int i = 0; i < 10; i++) {
Runnable worker = new WorkerThread("" + i);
executor.execute(worker);
}
executor.shutdown();
while (!executor.isTerminated()) {
}
System.out.println("Finished all threads");
}
}
The application will be deployed in Websphere Web server in with settings contain a Thread Pool configuration : Application servers > > Thread Pools > Default, the Maximum Size is set to 60.
My question is, which Pool size configuration is taken, does the configuration in Websphere override the one in the code(5 threads) ?
Those two things have nothing to do with each other.
The server setting is about threads used by the server. See the documentation:
Use this page to configure a group of threads that an application server uses. Requests are sent to the server through any of the HTTP transports. A thread pool enables components of the server to reuse threads to eliminate the need to create new threads at run time. Creating new threads expends time and resources.
Now, your application code creates its own independent thread pool.
Which has nothing to do with that system pool.
Of course, it might be possible for your application to send "tasks" to that system thread pool; making use of it that way.