读书笔记系列 - Operating Systems: Three Easy Pieces - Virtualization - Chapter 5: Process API

简介: 读书笔记系列 - Operating Systems: Three Easy Pieces - Virtualization - Chapter 5: Process API

5. Process API

  1. UNIX presents one of the most intriguing ways to create a new process with a pair of system calls: fork() and exec().

5.1 The fork()System Call

  1. The fork() system call is used to create a new process.
  2. The CPU scheduler determines which process runs at a given moment in time.


5.2 The wait() System Call

5.3 Finally, The exec() System Call

  1. This exec() system call is useful when you want to run a program that is different from the calling program.

5.4 Why? Motivating The API

5.5 Process Control And Users


  1. Beyond fork(), exec(), and wait(), there are a lot of other interfaces for interacting with processes in UNIX systems.
  2. The kill() system call is used to send signals to a process, including directives to pause, die, and other useful imperatives.

5.6 Useful Tools

5.7 Summary

  1. Each process has a name; in most systems, that name is a number known as aprocess ID (PID).
  2. The fork() system call is used in UNIX systems to create a new process. The creator is called the parent; the newly created process is called the child. As sometimes occurs in real life, the child process is a nearly identical copy of the parent.
  3. The wait() system call allows a parent to wait for its child to complete execution.
  4. The exec() family of system calls allows a child to break free from its similarity to its parent and execute an entirely new program.
  5. A UNIX shell commonly uses fork(), wait(), and exec() to launch user commands; the sparation of fork and exec enables features like input/output redirection, pipes, and other cool features, all without changing anything about the programs being run.
  6. Process control is available in the form of signals, which can cause jobs to stop, continue, or even terminate.
  7. Which processes can be controlled by a particular person is encapsulated in the notion of a user; the operating system allows multiple users onto the system, and ensures users can only control their own processes.
  8. A super user can control all processes (and indeed do many other things); this role should be assumed infrequently and with caution for security reasons.


目录
相关文章
|
6月前
|
存储 SQL Shell
【OSTEP】Abstraction Process | 进程 | 虚拟化 | 进程API
【OSTEP】Abstraction Process | 进程 | 虚拟化 | 进程API
30 0
|
API C# Windows
C#实现操作Windows窗口句柄:常用窗口句柄相关API、Winform中句柄属性和Process的MainWindowHandle问题【窗口句柄总结之三】
本篇主要介绍一些与窗口句柄相关的一些API,比如设置窗口状态、当前激活的窗口、窗口客户区的大小、鼠标位置、禁用控件等,以及介绍Winform中的句柄属性,便于直接获取控件或窗体句柄,以及不推荐...
1752 0
C#实现操作Windows窗口句柄:常用窗口句柄相关API、Winform中句柄属性和Process的MainWindowHandle问题【窗口句柄总结之三】
|
开发工具
The emulator process for AVD Pixel_API_30 was killed.
The emulator process for AVD Pixel_API_30 was killed.
The emulator process for AVD Pixel_API_30 was killed.
|
开发工具 Android开发
Error while waiting for device: The emulator process for AVD Pixel_API_30 has terminated.
Error while waiting for device: The emulator process for AVD Pixel_API_30 has terminated.
2878 0
Error while waiting for device: The emulator process for AVD Pixel_API_30 has terminated.
|
开发工具 Android开发
Error while waiting for device: The emulator process for AVD Pixel_2_XL_API_28 was killed.
Error while waiting for device: The emulator process for AVD Pixel_2_XL_API_28 was killed.
968 0
Error while waiting for device: The emulator process for AVD Pixel_2_XL_API_28 was killed.
|
测试技术
SAP LSMW Error in method CL_API_MASTER_CONDITION_MM => PROCESS
SAP LSMW 导入Open SA数据,Error - System error (error in method  CL_API_MASTER_CONDITION_MM => PROCESS)    【e...
1889 0
|
JavaScript Shell Linux
node.js入门 - 12.api:进程(process)
  虽然node对操作系统做了很多抽象的工作,但是你还是可以直接和他交互,比如和系统中已经存在的进程进行交互,创建工作子进程。node是一个用于事件循环的线程,但是你可以在这个事件循环之外创建其他的进程(线程)参与工作。
892 0
|
1天前
|
存储 缓存 运维
DataWorks操作报错合集之DataWorks根据api,调用查询文件列表接口报错如何解决
DataWorks是阿里云提供的一站式大数据开发与治理平台,支持数据集成、数据开发、数据服务、数据质量管理、数据安全管理等全流程数据处理。在使用DataWorks过程中,可能会遇到各种操作报错。以下是一些常见的报错情况及其可能的原因和解决方法。
8 1
|
1天前
|
SQL 数据管理 API
数据管理DMS产品使用合集之阿里云DMS提供API接口来进行数据导出功能吗
阿里云数据管理DMS提供了全面的数据管理、数据库运维、数据安全、数据迁移与同步等功能,助力企业高效、安全地进行数据库管理和运维工作。以下是DMS产品使用合集的详细介绍。
|
2天前
|
运维 Serverless API
Serverless 应用引擎产品使用之在阿里函数计算中开启函数计算 API 接口如何解决
阿里云Serverless 应用引擎(SAE)提供了完整的微服务应用生命周期管理能力,包括应用部署、服务治理、开发运维、资源管理等功能,并通过扩展功能支持多环境管理、API Gateway、事件驱动等高级应用场景,帮助企业快速构建、部署、运维和扩展微服务架构,实现Serverless化的应用部署与运维模式。以下是对SAE产品使用合集的概述,包括应用管理、服务治理、开发运维、资源管理等方面。
99 6