The difference between threads and processes

Source: Internet
Author: User

A thread is an execution unit within a process and a scheduler within a process.
differences from the process:
(1) Memory
Space: An execution unit within a process; The process has at least one thread; they share the address space of the process, and the process has its own independent address space ;
(2) Resource ownership: A process is a resource that is allocated and owned by a thread in a process that shares the resources of the process
(3) The thread is the basic unit of the processor dispatch, but the process is not.
A program has at least one process, and a process has at least one thread. A process is an independent unit of the system's resource allocation and scheduling. A thread is an entity of a process that is the basic unit of CPU dispatch and dispatch, which is a smaller unit that can run independently than a process. The thread itself basically does not own system resources, Has only a few resources (such as program counters, a set of registers, and stacks) that are essential to the operation, but it can share all of the resources owned by the process with other threads that belong to one process.

The difference between threads and processes

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.