Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
3_4_format.doc
Скачиваний:
0
Добавлен:
01.05.2025
Размер:
94.21 Кб
Скачать

Lab № 3

Management processes

1 Purpose of

1.1 To study the processes in FreeBSD.

1.2 Become familiar with the process.

1.3 Implement management processes.

2 Key provisions

2.1 Process control: general

The process is a separate thread of execution or a single stream of instructions a computer. The process - an information context, having a single address space and consists typically of three segments - Package (includes instructions (program) management processor), data and stack. Each process runs in its own virtual address space. Appeal to the real address space is possible only at the kernel level. Process control functions as the nucleus, called a virtual machine (VM). Prior to the life of his data and code stored in a file called an executable. In addition to static data on the stage of execution of the OS process provides additional data, such as a table of file handles, environment variables, dynamically allocated memory.

Start the process can be just another process. It creates a hierarchy of processes. The first process, having no parent process is init, which starts at boot time operating system.

Each UNIX process assigns the control terminal, which are associated to three standard devices: input, output and error output.

Among the user processes in UNIX are allocated, so-called daemon processes. These are processes that can be performed throughout the operating system. Such processes should have as a parent init process and do not have a controlling terminal.

It may seem that, in UNIX everything is done simultaneously, but in reality, in a unit time runs only one process. The illusion of parallel execution method creates a "time-quantizing", whereby the system at regular intervals alter the current running process.

The system administrator can monitor the status of the process, to manage the allocation of CPU time each process, pause and forcibly terminates the process.

As mentioned above, each process consists of the address space and a set of data structures contained in the nucleus of the system. The most important data in the structures include:

  • table of memory allocation process;

  • current status of the process;

  • priority of the process;

  • resource information system used by the process;

  • process owner.

Each new process is assigned a unique number PID. Actual value of PID does not play a big role, it is assigned the kernel simply in order, starting with 0 and till 65535. When the number ends, the kernel re-starts at 0, passing still exist in the PID.

The new process in UNIX is created by cloning an existing process, after which the text (i.e., a set of instructions for the processor) the new process replaced with a program that process should execute. The UNIX source process is called the parent and its clone - generated by or a subsidiary.

In addition to its own identifier PID, each process has an attribute of its parent process - PPID.

Each process has a UID - User ID who created the process. Making changes to the process may only its creator and a privileged user (root). There is also a process EUID-the so-called "effective" UID. It is used to determine which resources a process has access rights. Typically, EUID and UID match. They differ for the programs in which the bit is changing the user ID (the so-called suid - program).

Similarly, GID - identification number of the person who created the process, EGID - "effective" GID. When the process is started, its GID is equal to the GID of the parent process. If the process tries to access a file that is not the owner permissions, the kernel checks to be whether to allow issued pursuant EGID.

The owner of the process is the owner of the parent. Accordingly, considered the right of access to the files. However, UNIX has mechanisms for change of ownership process. The first mechanism is implemented, for example, in process login. This process runs as root, but after a successful registration process runs the shell as the user. The second mechanism is based on specific bits of empowerment. If you have a bit of empowerment to the user (SUID) - the process does not comply with the human user who launched it, and with the owner of the file. For example, if the owner of the file is root and suid-bit set, the process executed with rights of superuser.

When a user enters a command, interpreter Shell is for your terminal manager process. This means that the interpreter is a process that accepts user input.

The very existence of the process does not give him the right to receive CPU time. The process can be in various states:

Waiting - waiting for the process of allocating a resource

Zombie process - When the process completes, it notifies its parent of approaching death. After receiving confirmation of its PID is removed from the process table. Zombie process - a process whose resources were fully released, but the completion of which has not been confirmed by his parents. Normally, if the parent is no longer in the system, interferes with the process of init. But sometimes it does not.

Swapped - the process is in the swap-partition on the disk.

Stopped - process suspended. Workable process has received all necessary resources and is just waiting for the allocation of CPU time for data processing.

Waiting process is waiting for a certain event. For example, the command interpreter waits for user commands from the keyboard and spends in a waiting state most of his time.

Swapped process does not exist in memory. It is written in swap-section on the disc and wait "for the hour."

From time to time appear in the system processes, one way or another require administrator intervention. The main types of such processes - depended and unmanaged processes.

Crashed processes do not do anything, do not meet its controlling terminal, and just "hang", taking up system resources. Unmanaged processes are of two types - user and system. Unmanaged user process does not necessarily work correctly. All he can "eat" a lot of system resources, and because it would be idle others may not be less than helpful processes.

Unmanaged system process may simply unpredictable effect on system performance.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]