Introduction to Operating System

本贴最后更新于 2025 天前,其中的信息可能已经时移世易

Concept

OS Elements

  • Abstractions
    • process
    • thread
    • file
    • socket
    • memory
    • page
  • Mechanisms
    • create
    • schedule
    • open
    • write
    • allocate(分配)
  • Policies(策略)
    • least-recently used(LRU)
    • earliest deadline first (EDF)

关于 Mechanisms 和 Polices 的区别我其实迷惑了很久。

其实总结出来很简单 Mechanisms 机制 指的是 what to do

Polices 指的是 how to do

也可以这样理解机制是策略的更高一层抽象,策略是指具体如何实现的方式,机制则是我需要这个功能,但是不关注实现。

举个例子就是 Linux 内核的调度器(scheduler),提供了任务调度需要的原语操作和结构,并且实现了多种调度算法。

Process

what is a Process : state of a program when executing loaded in memory. (active entity)

  • instance of an executing program
  • Synonymous with "task" or "job"

A process is like an order of toys

  • State of execution

    • program counter
    • stack
  • parts & temporary holding area

    • data. register state, occupies state in memory
  • may require special hardware

    • I/O devices

what does process look like ?

1559835354626

Process Control Block

1559887343136

  • PCB created when process is created.
  • certain fields are update when process state changes
  • other fields changed too frequently

Context Switch(上下文切换)

相关帖子

欢迎来到这里!

我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。

注册 关于
请输入回帖内容 ...