Java Threading Learning

Source: Internet
Author: User
Threading Concepts

When I ask someone what is a thread, someone tells me a lot of threads how to create, how to use and a number of threads of advanced issues, in fact, as a veteran rookie, I would like to ask, what is the thread, find some concepts in the book summed up, multi-threading and operating system multi-tasking (process) The environment has many similarities. Multitasking in the operating system allocates different time periods for the CPU to different processes, because each process is executed in a very short time (as opposed to the concept of a person's time), the process switches between processes quickly and executes multiple processes in a very short period of time, thus giving the senses a sense of concurrent execution of multiple processes ( Multi-core CPUs may implement concurrent execution), the thread is the concept of a program, a program executes a task that is a process, a program can perform multiple tasks concurrently, the program is a multithreaded program. Multi-threaded routines extend the multi-tasking concept at a lower level.

What is the difference between a process and a thread? The essential difference between the two is that the process has its own set of independent variables, while threads are shared data, and thread-sharing variables make communication between threads more efficient and easier.

Java Threading Learning

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.