美文网首页
OS 面试题

OS 面试题

作者: Zihowe | 来源:发表于2017-09-27 13:14 被阅读147次

Operating System

进程和线程有什么区别
Both processes and threads are independent sequences of execution. The typical difference is that threads (of the same process) run in a shared memory space, while processes run in separate memory spaces.

A process has a virtual address space, executable code and at least one thread of execution. Each process is started with a single thread, often called the primary thread, but can create additional threads from any of its threads.

A thread is an entity within a process that can be scheduled for execution. All threads of a process share its virtual address space and system resources

什么是锁mutex

MUTEX 互斥锁 mutual exclusion
是一个mechanism,防止出现race-condition。
在多线程编程中, 我们防止两条线程对同一个资源进行modify的机制。

Threads within a given process share the same memory space. It enables threads to share data, which can be valuable. However, it also creates the opportunity for issues when two thread modifies a resource at the same time.

我们要求一个critical section只能有一个线程进入。

Deadlock

a deadlock is a situation where a thread is waiting for an object lock that another thread holds, and this second thread is waiting for an object lock that the first thread holds. Since each thread is waiting for the other thread to relinquish a lock, the both remain waiting forever.
The threads are said to be deadlocked.

Most deadlock prevention algorithms focus on avoiding the circular wait.

什么是信号量

什么是栈溢出

不同存储结构的速度量级(磁盘、SSD、内存、L1 cache)

什么是IO

References:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms681917(v=vs.85).aspxea

相关文章

  • OS 面试题

    Operating System 进程和线程有什么区别Both processes and threads are...

  • python中的os模块

    import os 导入os模块 help(os) 查看帮助文档 import os print(os.get...

  • python os模块

    os模块 os.name() os.getcwd() os.listdir(path) os.path.isfil...

  • 2018-09-17

    os.listdir、os.mkdir和os.makedirs的用法 os.listdir os.listdir返...

  • Python爬虫大杂烩

    1.os操作文件:os.makedirs、os.path.join、os.chdir os.makedirs 表示...

  • Python编程快速上手-第八章

    文件路径 os.getcwd() / os.chdir() / os.makedirs() / os.getcwd...

  • python os,shutil基本使用

    import os if not os.path.exists(Dir): os.mkdir(Dir) os.re...

  • 面试材料

    面试经验 面试题1 面试题2 面试题3 面试题4 面试题5 面试题6――数据结构 面试题7――网络 面试题8――汇...

  • 高阶面试题

    webpack面试题 面试题:webpack插件 Git面试题 面试题:git常用命令 面试题:解决冲突 面试题:...

  • this的指向的面试题

    面试题1 面试题2 面试题3 面试题4

网友评论

      本文标题:OS 面试题

      本文链接:https://www.haomeiwen.com/subject/jpquextx.html