Diagram
The above picture describes the main structure of the thread pool which
Public Interface Executor { // // A new thread, or thread pool, or calling void Execute (Runnable command);}
Public Abstract classAbstractexecutorserviceImplementsExecutorservice {protected<T> runnablefuture<t>newtaskfor (Runnable Runnable, T value)protected<T> runnablefuture<t> newtaskfor (callable<t>callable) PublicFuture<?>Submit (Runnable Task) Public<T> future<t>Submit (Runnable task, T result) Public<T> future<t> Submit (callable<t>Task)Private<T> T doinvokeany (collection<?extendsCallable<t>>Tasks,BooleanTimedLongNanos); Public<T> T invokeany (collection<?extendsCallable<t>>tasks); Public<T> T invokeany (collection<?extendsCallable<t>>Tasks,LongTimeout, timeunit unit); Public<T> list<future<t>> InvokeAll (collection<?extendsCallable<t>>tasks); Public<T> list<future<t>> InvokeAll (collection<?extendsCallable<t>>Tasks,LongTimeout, timeunit unit)}
Java-thread pool