Thread Pool of {Java}

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.