Processes and Threads

Source: Internet
Author: User

Part 1:processes

Process:an abstraction of running program.

A CPU can really only run one process at a time, if there is both cores each one of the them can run only one process at a Tim E.

Process Creation

Operating systems need some to create processes. There is four events this cause processes to be created:

    1. System initialization
    2. Execution of a process creation system call by a running process
    3. A user request to create a new process
    4. Initiation of a batch job

daemons: processes that stay in the background to handle some activity such as e-mail, Web pages, news, printing, And so on.

Note:in UNIX, the PS program can is used to list the running processes. In Windows, Task Manager.

Note:in UNIX, only one system call to create a new process: fork. In Windows, CreateProcess

Process termination, usually due to one of the following conditions:

    1. Normal exit (voluntary)
    2. Error exit (voluntary)
    3. Fatal Error (involuntary)
    4. Killed by another process (involuntary)

Note: exit () in UNIX and exitprocess () in Windows

Process states

    • Running (actually using the CPU at that instant)
    • Ready (runnable; temporaily stopped-let another process run)
    • Blocked (unable to run until some external event happens)

Part 2:threads

Processes and Threads

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.