Shell learns 49 days----process builds

Source: Internet
Author: User

Tag: Indicates a startup error system output mod writing preface inux

Process

Preface : A process refers to an instance of a running program . The new process consists of Fork () with the Execve () when the system call starts , and then run , know that they have issued exit () until the system calls .

LinuxSystems support multiple processes.Although the computer looks like it's done a lot of things at once,,but unless he's got multipleCPU,Otherwise, doing a lot of things at once is just an illusion ..actually,Each process is allowed to run only in a very short period of time,We call it time fragments .,then the process will be temporarily shelved,let the other waiting processes run.very short time fragments,usually there are only a few subtle,so people feel very little about the process of returning control to the kernel,And then handing over to another process such as this text switch.The process itself does not manage text switching.,There is no need to write a withdrawal of control in the programOSthe processing.

The part of the operating system kernel , called the Scheduler, is responsible for managing the running of the process . when there are multiple CPu when , the scheduler tries to use all CPU working with workloads . In addition to the user's view of improved response speed , I'm probably not aware of any difference . .

The process is assigned a priority , so that a process that has time to consider can run first than a non-critical process . Nice and renice command is used to adjust the priority of a process .

At any moment , the average number of waiting processes to run is called the mean load , the simplest uptime command to display :

$uptime

20:30:35 up-min, 2 users, load average:0.05, 0.11, 0.05

Analysis : shows the time since power on , the number of users , and the average load .

Because the average load will always change , uptime will return three average time estimates , respectively, last minute , five minutes , and a 10-minute estimate. . when the average load continues to exceed the available CPU the load-time , indicates that the system is more than it can load . , at this point the response may be stuck in a stagnant state .

Process Establishment

Very many programs have shell launches : The first word in each command line is to identify the program to run . a command Shell each process that starts , will be listed below to ensure that the event starts :

1. The process has a kernel this article : data Structures in the kernel Record process-related information , making the kernel easy to manage and control the process of running .

2. The process has a private protected virtual address space It may be as large as the machine addressable space Span style= "Font-family:times New Roman". just on an instance memory and an external storage device. swap space combined size other working size or the local setting of the system tuning parameter

3. Three file descriptive descriptors ( standard input Span style= "Font-family:times New Roman", standard output , standard error output all open

4. Start in the chat mode Shell process , will have a control terminal , which plays three standard file data stream to the default source and destination . the control terminal allows the user to transmit the signal to the process .

5. Wildcard characters in command-line parameters are expanded

6. An environment variable area of memory exists , including a string with a key and a value specified , which can be obtained through the library call .

These assurances are not treated in any different regard ; all processes running at the same priority level are treated equally , and the process can be written in no matter what program .

Private address space ensures that processes are not affected by other programs. Other cities or cores interfere . operating systems that do not provide such protection are very easy to make mistakes .

These three open files are sufficient for most programs to use them without worrying about file opening and closing operations , There is no need to know either the file name syntax or the file system .

A wildcard string that is expanded by the Shell relieves a very heavy burden on the program and provides uniform command-line processing .

Environment Space There is also a way to provide information to the process , In addition to the command and input files .

Shell learns 49 days----process builds

Related Article

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.