Understanding threads and processes correctly

Source: Internet
Author: User

These concepts I believe there are a lot of Baidu, here, I am a programmer's point of view.

Process is a static concept, the machine is running a thread, a process can contain multiple threads.

An EXE file, class file is a process, at a point in time, a CPU on only one thread,

But it's very fast, so it's like there are multiple processes running at the same time.

In Java, there are two ways to start a new thread:

1. Inherit from the thread class. 2. Implement Runnable Interface (refer to other information, not detailed here)

Understanding threads and processes correctly

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.