| Executorservice: |
Real thread pool interface. |
| Scheduledexecutorservice |
It can be similar to Timer/timertask to solve the problem of repeated task execution. |
| Threadpoolexecutor |
Executorservice default implementation. |
| Scheduledthreadpoolexecutor |
Inherits the implementation of the scheduledexecutorservice interface of threadpoolexecutor and class implementation of periodic task scheduling. |
Threadpoolexecutor http://dongxuan.iteye.com/blog/901689
Threadpoolexecutor (INT corepoolsize, int maximumpoolsize,
Long KeepAliveTime, timeunit unit,
Blockingqueue <runnable> workqueue,
Rejectedexecutionhandler handler)
Corepoolsize: Minimum number of threads maintained by the thread pool
Maximumpoolsize: Maximum number of threads maintained by the thread pool
KeepAliveTime: the idle time allowed by the thread pool to maintain the thread
Unit: the unit of idle time allowed by the thread pool maintenance thread.
Workqueue: The Buffer Queue used by the thread pool.
Handler: processing policy of the thread pool to reject tasks
A task is added to the thread pool using the execute (runnable) method. A task is a runnable object. The execution method of a task is the run () method of a runnable object.
Java database connection pool.