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


目录
相关文章
|
10月前
|
存储 SQL Shell
【OSTEP】Abstraction Process | 进程 | 虚拟化 | 进程API
【OSTEP】Abstraction Process | 进程 | 虚拟化 | 进程API
43 0
|
API C# Windows
C#实现操作Windows窗口句柄:常用窗口句柄相关API、Winform中句柄属性和Process的MainWindowHandle问题【窗口句柄总结之三】
本篇主要介绍一些与窗口句柄相关的一些API,比如设置窗口状态、当前激活的窗口、窗口客户区的大小、鼠标位置、禁用控件等,以及介绍Winform中的句柄属性,便于直接获取控件或窗体句柄,以及不推荐...
2749 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.
3177 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.
1034 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...
1909 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.
790 0
|
JavaScript Shell Linux
node.js入门 - 12.api:进程(process)
  虽然node对操作系统做了很多抽象的工作,但是你还是可以直接和他交互,比如和系统中已经存在的进程进行交互,创建工作子进程。node是一个用于事件循环的线程,但是你可以在这个事件循环之外创建其他的进程(线程)参与工作。
908 0
|
1月前
|
机器人 API Python
智能对话机器人(通义版)会话接口API使用Quick Start
本文主要演示了如何使用python脚本快速调用智能对话机器人API接口,在参数获取的部分给出了具体的获取位置截图,这部分容易出错,第一次使用务必仔细参考接入参数获取的位置。
|
21天前
|
存储 JSON API
淘系API接口(解析返回的json数据)商品详情数据解析助力开发者
——在成长的路上,我们都是同行者。这篇关于商品详情API接口的文章,希望能帮助到您。期待与您继续分享更多API接口的知识,请记得关注Anzexi58哦! 淘宝API接口(如淘宝开放平台提供的API)允许开发者获取淘宝商品的各种信息,包括商品详情。然而,需要注意的是,直接访问淘宝的商品数据API通常需要商家身份或开发者权限,并且需要遵循淘宝的API使用协议。
淘系API接口(解析返回的json数据)商品详情数据解析助力开发者