![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
操作系统
文章平均质量分 59
天蝎座的程序员
这个作者很懒,什么都没留下…
展开
-
002.进程api
1.fork()系统调用系统调用 fork()用于创建新进程.#include <stdio.h>#include <stdlib.h>#include <unistd.h>int main(int argc, char *argv[]){ printf("hello world (pid:%d)\n", (int) getpid()); int rc = fork(); if (rc < 0) { // fork faile原创 2022-05-12 00:08:17 · 233 阅读 · 0 评论 -
001.操作系统初步浅谈
操作系统运行程序过程必须做的第一件事是将代码和所有静态数据(例如初始化变量)加载(load)到内存中,加载到进程的地址空间中。程序最初以某种可执行格式驻留在磁盘上,因此,将程序和静态数据加载到内存中的过程,需要操作系统从磁盘读取这些字节,并将它们放在内存中。将代码和静态数据加载到内存后,操作系统在运行此进程之前还需要执行其他一些操作。必须为程序的运行时栈(run-time stack 或 stack)分配一些内存。进程的状态运行(running):在运行状态下,进程正在处理器上运行。这意原创 2022-05-11 23:24:21 · 386 阅读 · 0 评论