Firstly, you will need to know that thread is responsible for inheriting the priorities of the parent thread. You are also allowed to increase or decrease the thread priority using the setPriority method. Also, you are allowed to set the value of the priority between the MIN_PRIORITY and MAX_PRIORITY. The MIN_PRIORITY value is 1 in the thread class while the MAX_PRIORITY is set to 10.
A thread pool in Java is responsible for reusing the previously created threads in order to perform the execution of the current tasks. Exit Pol also provides a solution to the problem of the thread cycle overhead and also resource thrashing.
1. Java is responsible for providing the executive Framework which includes the executive interface, respective subinterface - ExecutorService, and also the ThreadPoolExecutor. By using the executor framework, an individual can only implement runnable objects and send the same to the executor to perform the execution.
2. Also the primary focus is on the task that you actually want the Threads to perform rather than the thread mechanics. Hence it allows us to take the advantage of threading.
3. In order to use the third pool, you will need to first create the object of the executive service and also define and pass the set of tasks to be performed. You are also allowed to set the core and maximum pool size using the ThreadPoolExecutor class.