The difference between a process, a thread, a service, a task

Source: Internet
Author: User

 

A process is a running application in which each process has its own separate memory space. An application can start multiple processes at the same time. For example, for IE browser program, each open an IE browser window, start a new process. Similarly, each time the JDK's Java.exe program is executed, a separate Java Virtual machine process is launched that is tasked with parsing and executing Java program code.

A thread is an execution process in a process, sometimes called an execution scenario. (thread) is the smallest unit in which the operating system can perform operations. A process can consist of multiple threads, which can run multiple different threads at the same time in one process, performing different tasks separately. When multiple threads in a process run concurrently, this is called running concurrently . Many server programs, such as database servers and Web servers, support concurrent runs, which can respond to requests from different customers at the same time.

The main difference between a process and a thread is that each process requires the operating system to allocate its own memory address space, while all threads in the same process work in the same address space, which can share the same block of memory and system resources, such as sharing an object or sharing a file that has already been opened.

service is actually no interface, silently running in the system backstage, he can provide some more features of the application of things, such as playing MP3, open a play MP3 service, the user click the Start button to notify the service to open, click the Close button to notify the service off, if you disable this service, The other people want to play MP3 that is not good, and the service is likely to rely on each other.

Some mobile phone defenders: Blacklist phone interception function, the background also maintains a service;

A task is an activity that is done by the software. A task is a more abstract concept, a generic term, a task that can be either a process or a thread. In short, it refers to a series of operations that collectively achieve a purpose. For example, read the data and put the data in memory. This task can be implemented as a process, or as a thread (or as an interrupt task).

Original link: http://blog.csdn.net/knighttools/article/details/8231055

Http://www.veryarm.com/1374.html

The difference between a process, a thread, a service, a task

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.