什么是存储过程_什么是过程?

什么是存储过程

什么是过程? (What is a Process?)

A process is a program in execution. Process is not as same as program code but a lot more than it. A process is an 'active' entity as opposed to program which is considered to be a 'passive' entity. Attributes held by process include hardware state, memory, CPU etc.

进程是正在执行的程序。 流程与程序代码不同,但远不止于此。 与被认为是“被动”实体的程序相比,过程是“主动”实体。 进程拥有的属性包括硬件状态,内存,CPU等。

Process memory is divided into four sections for efficient working :

进程存储器分为四个部分,以提高工作效率:

  • Text section is made up of the compiled program code, read in from non-volatile storage when the program is launched.文本部分由编译后的程序代码组成,在程序启动时从非易失性存储器中读取。
  • Data section is made up the global and static variables, allocated and initialized prior to executing the main.数据部分由全局变量和静态变量组成,在执行主变量之前进行分配和初始化。
  • Heap is used for the dynamic memory allocation, and is managed via calls to new, delete, malloc, free, etc.用于动态内存分配,并通过调用new,delete,malloc,free等进行管理。
  • Stack is used for local variables. Space on the stack is reserved for local variables when they are declared.堆栈用于局部变量。 声明局部变量时,将在堆栈上保留空间。

不同的处理状态 (Different Process States)

Processes in the operating system can be in any of the following states:

操作系统中的进程可以处于以下任何状态:

  • NEW- The process is being created.NEW -正在创建过程。
  • READY- The process is waiting to be assigned to a processor.READY -进程正在等待分配给处理器。
  • RUNNING- Instructions are being executed.RUNNING -指令正在执行。
  • WAITING- The process is waiting for some event to occur(such as an I/O completion or reception of a signal).WAITING -进程正在等待某些事件发生(例如I / O完成或信号接收)。
  • TERMINATED- The process has finished execution.TERMINATED -进程已完成执行。

什么是存储过程_什么是过程?

过程控制块 (Process Control Block)

There is a Process Control Block for each process, enclosing all the information about the process. It is a data structure, which contains the following:

每个过程都有一个过程控制块,其中包含有关该过程的所有信息。 它是一个数据结构,其中包含以下内容:

  • Process State: It can be running, waiting etc.进程状态 :可以运行,等待等
  • Process ID and the 进程IDparent process ID.父进程ID
  • Program Counter holds the address of the next instruction to be executed for that process.程序计数器保存该进程要执行的下一条指令的地址。
  • CPU Scheduling information: Such as priority information and pointers to scheduling queues.CPU调度信息:例如优先级信息和指向调度队列的指针。
  • Memory Management information: For example, page tables or segment tables.内存管理信息 :例如,页表或段表。
  • Accounting information: The User and kernel CPU time consumed, account numbers, limits, etc.记帐信息 :消耗的用户和内核CPU时间,帐号,限制等。
  • I/O Status information: Devices allocated, open file tables, etc.I / O状态信息 :分配的设备,打开的文件表等

什么是存储过程_什么是过程?

翻译自: https://www.studytonight.com/operating-system/operating-system-processes

什么是存储过程