读书笔记系列 - 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.


目录
相关文章
|
11月前
|
存储 SQL Shell
【OSTEP】Abstraction Process | 进程 | 虚拟化 | 进程API
【OSTEP】Abstraction Process | 进程 | 虚拟化 | 进程API
47 0
|
API C# Windows
C#实现操作Windows窗口句柄:常用窗口句柄相关API、Winform中句柄属性和Process的MainWindowHandle问题【窗口句柄总结之三】
本篇主要介绍一些与窗口句柄相关的一些API,比如设置窗口状态、当前激活的窗口、窗口客户区的大小、鼠标位置、禁用控件等,以及介绍Winform中的句柄属性,便于直接获取控件或窗体句柄,以及不推荐...
2820 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.
3224 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.
1038 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...
1914 0
|
Linux API 虚拟化
Virtualization API之libvirt
The virtualization API 之开源 libvirt探究 By Ruiy: libvirt supports Hypervisors(注,相关的hypervisors项目的权威网站已经加入到链接中,感兴趣探究): The KVM/QEMU Linux hypervisor The Xen hypervisor on Linux and Solaris hosts.
794 0
|
JavaScript Shell Linux
node.js入门 - 12.api:进程(process)
  虽然node对操作系统做了很多抽象的工作,但是你还是可以直接和他交互,比如和系统中已经存在的进程进行交互,创建工作子进程。node是一个用于事件循环的线程,但是你可以在这个事件循环之外创建其他的进程(线程)参与工作。
910 0
|
2月前
|
机器人 API Python
智能对话机器人(通义版)会话接口API使用Quick Start
本文主要演示了如何使用python脚本快速调用智能对话机器人API接口,在参数获取的部分给出了具体的获取位置截图,这部分容易出错,第一次使用务必仔细参考接入参数获取的位置。
121 1
|
12天前
|
安全 API 开发者
Web 开发新风尚!Python RESTful API 设计与实现,让你的接口更懂开发者心!
在当前的Web开发中,Python因能构建高效简洁的RESTful API而备受青睐,大大提升了开发效率和用户体验。本文将介绍RESTful API的基本原则及其在Python中的实现方法。以Flask为例,演示了如何通过不同的HTTP方法(如GET、POST、PUT、DELETE)来创建、读取、更新和删除用户信息。此示例还包括了基本的路由设置及操作,为开发者提供了清晰的API交互指南。
52 6