摘要:
一 临界区问题 1 do{ 2 进入区 3 临界区 4 退出区 5 剩余区 6 }while(TRUE); 临界区:每个进程有一个代码段称为临界区,该区中进程可能改变共同变量、更新一个表、写一个文件等。 进入区:请求允许进入临界区。 退出区: 剩余区:剩余代码 必须满足:互斥:若进程Pi在其临界区内 阅读全文
摘要:
1.CPU调度程序 每当CPU空闲时,OS必须从就绪队列选择一个进程来执行。进程选择由短期调度程序或CPU调度程序执行。调度程序从内存中选择一个能执行的进程,并为之分配CPU。 2.抢占:可以选择 (1)当一个进程从运行状态切换到就绪状态;(eg:当出现中断时) (2)当一个进程从等待状态切换到就绪 阅读全文
摘要:
关于多线程,需要看https://blog.csdn.net/column/details/killthreadseries.html 大神写的专题 1.线程概念 线程是CPU使用的基本单元,它由线程ID、程序计数器、寄存器集合和栈组成。它与属于同一进程的其他线程共享代码段、数据段和其他操作系统资源 阅读全文
摘要:
1.概念: 进程包括文本段(代码段)、当前活动、程序计数器的值、处理器寄存器的内容、堆栈段(including 临时数据,如函数参数,返回地址和局部变量)、数据段(including 全局变量)和堆(进程运行期间动态分配的内存)。 注意:程序(可执行文件)本身不是进程,程序只是被动实体,进程是活动实 阅读全文
摘要:
题目: Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number. An example is the root-to-leaf path1->2->3whic 阅读全文
摘要:
题目: Reverse a linked list from position m to n. Do it in-place and in one-pass. For example: Given1->2->3->4->5->NULL, m = 2 and n = 4, For example: G 阅读全文
摘要:
题目: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep 阅读全文
摘要:
题目: Given a singly linked list L: L 0→L 1→…→L n-1→L n,reorder it to: L 0→L n →L 1→L n-1→L 2→L n-2→…You must do this in-place without altering the node 阅读全文
摘要:
1.网络协议三要素: 语法 语义 时序 2.电路交换 2.1端到端连接 2.2多路复用 频分多路复用(FDM) 时分多路复用(TDM)波分多路复用(WDM) 码分多路复用(CDM) 3.报文交换 4.分组交换 4.1 端系统彼此之间交换报文(message)。为了从源端系统向目的端系统发送一个报文, 阅读全文