Preliminary understanding of process management, memory management, storage management

Source: Internet
Author: User

Process Management

Processes require a certain amount of resources (including CPU time, memory, files, I/O devices) to complete their tasks. These resources can be assigned to a process when the process is created, or it can be assigned to a process when the process is executed. In addition to the various physical and logical resources that are created, processes can accept various initialization data (inputs) that are transmitted.

It is important to note that the program is not a process, the program is a passive entity, and the process is an active entity.

Definition of process and thread:

A process is a program with a certain independent function on a data set on a sequential run of activities, the process is the system for resource allocation and scheduling of independent units.

A thread is an entity of a process that is the basic unit of CPU and allocation. The thread itself does not own the system resources, only the resources that are essential in the run (such as program counters, registers, and stacks), but it can share all of the resources owned by the process with other threads that belong to one process.

Process-to-thread relationship:

One thread can create and revoke another thread. Can be executed concurrently between multiple threads in the same process.

Relative to a process, a thread is a concept that is closer to the execution body, it can share data with other threads in the process, but has its own stack space and has a separate execution sequence.

The difference between a process and a thread:

The process has a separate address space, and after a process crashes, it does not affect other processes in protected mode, and threads are just the different execution paths in the process. Thread has its own stack and local variables, but the thread does not have a separate address space, a thread dead equals the entire process to die, so the multi-process program is more robust than multithreaded programs, but in the process of switching, the consumption of large resources, the efficiency is worse. But for some concurrent operations that require simultaneous and shared variables, only threads can be used, and processes cannot be used.

① a program has at least one process, and a process has at least one thread.

The ② thread is smaller than the process, which makes the multi-thread procedure high concurrency.

The ③ process has independent memory units during execution, and multi-thread shared memory, which greatly improves the running efficiency of the program.

④ each separate thread has a program run entry, sequence of sequence execution, and exit of the program. However, threads cannot be executed independently, and must rely on the application to provide multiple threads of execution control.

⑤ multithreading is the meaning of an application where multiple execution parts can be executed at the same time. However, the operating system does not consider multiple threads as separate applications to implement scheduling and management of processes and resource allocation.

Pros and cons of processes and threads:

Thread execution costs are small, but not conducive to resource management and protection, and the process is the opposite. At the same time, threads are suitable for running on dual-CPU systems, while processes can run across machines.

The operating system is responsible for the following activities related to process management:

Create and delete user processes and system processes.

Suspend and restart processes

Provides a process synchronization mechanism

Provide process communication mechanisms

Provides a deadlock handling mechanism

Memory management

Memory is a data warehouse that can be quickly questioned by both the CPU and the I/O devices. The CPU reads the instruction from memory while acquiring the instruction cycle, while the data in memory is read and written (in the von Neumann structure) when the data period is obtained. If a program needs to be executed, it must first be transformed into an absolute address and loaded into memory. As the program executes, the process can access the in-memory program directives and data by generating an absolute address. Eventually, the program terminates, its memory space is freed, and the next program can be loaded and executed.

the operating system is responsible for the following activities related to memory management :

Record which part of the memory is being used and who is using it.

When there is memory space, decide which processes can be loaded into memory.

Allocate and free memory space as needed.

Storage Management

File System Management

High capacity Storage System management

Cache

I/O system

File System Management: is the most common part of the operating system. Tapes, disks, and discs are common storage media. Each medium needs to be controlled by a single device, such as disk drives and tape drives, including: access speed, capacity, data transfer efficiency, access method (sequential or random)

A file is a set of related information that is defined by its creator. Typically, files represent programs (source and target programs) and data. Data files can make numeric, character, character numeric, or binary. The file can have no format, or it can have a strict format.

The operating system implements the abstract concept of files by managing large-capacity storage. Files are usually made up of directories for ease of use. Finally, when multiple users can access the file, they need to control who and how to access the file.

The operating system is responsible for the following activities related to file management:

Create and delete files.

Create and delete directories to organize your files.

Provides the primitive language for manipulating files and directories.

Map the file to level two storage.

Back up files on the stable storage media.

mass Storage Management: because the memory is too small to hold all the data and programs, plus the power loss will lose all the data, the computer system must provide a level two memory (secondary storage) to back up memory. Most modern computer systems use hard disks as the primary online storage medium to store programs and data.

The operating system is responsible for the following activities related to hard Disk Management:

Free space management.

Storage space allocation.

Hard disk scheduling.

Because the two-level memory is used frequently, it must be efficient. But sometimes it uses lower-priced storage than the two-tier store, such as backup of disk data, infrequently used data, long-term archival storage. Tape drives and tape, CD/DVD drives, and discs are typical three-stage storage (tertiary storage) devices. These media formats include worm (write-once, multiple-read) and RW (read-write). Level three storage is not critical to system performance, but should be managed as well. Some operating systems manage them, while others give tier three storage management to application management.

Cache: information is usually stored in a storage system (such as memory). When it is used, it is temporarily copied to the faster storage system-the cache. When specific information is required, first check whether it is in the cache. If so, you can use the information in the cache directly, otherwise, use the information in memory and copy it to the cache for the next use.

Because the cache size is limited, the design of cache management is important. Careful selection of cache size and displacement policy can greatly improve performance.

I/O systems: One of the purposes of the operating system is to hide the characteristics of specific hardware devices from users. For example, in a UNIX system, the I/O subsystem hides the characteristics of I/O devices from the operating system itself. The I/O subsystem consists of the following sections:

A memory management section that includes cache, cache, and pretexting machines.

Universal Device Driver Interface

Drivers for specific hardware devices.

Preliminary understanding of process management, memory management, storage management

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.