《操作系统最经典三张纸.doc
文本预览下载声明
进程:
线程:
进程同步,临界区问题
死锁问题:
内存管理:
虚拟存储:
文件系统:
I/O 系统:
生产者-消费者问题(指利用了n-1个单元)
shared data
#define BUFFER_SIZE 10
typedef struct {
. . .
} item;
item buffer[BUFFER_SIZE];
int in = 0;
int out = 0;
item nextProduced; // local variable
while (1) {
/* produce an item in nextProduced */
while (((in + 1) % BUFFER_SIZE) == out);
buffer[in] = nextProduced;
in = (in + 1) % BUFFER_SIZE;
}
item nextConsumed; // local variable
while (1) {
while (in == out); // buffer is empty
nextConsumed = buffer[out];
out = (out + 1) % BUFFER_SIZE;
/* consume the item in nextConsumed */
}
调度队列的种类:
job queue – set of all processes in the system
ready queue – set of all processes residing in main memory, ready and waiting to executegenerally stored as a linked list
device queues – set of processes waiting for a particular I/O device, eg. a tape driver, a disk
进程状态:
new: being created
running: instructions are being executed
waiting: waiting for some event to occur
ready: waiting to be assigned to a processor
terminated: has finished execution
调度器scheduler分类:
long-term scheduler (or job scheduler) – selects which processes should be loaded for execution
short-term scheduler (or CPU scheduler) – selects which process should be executed next and allocates CPU
进程同步种类:
blocking(synchronous) versus nonblocking (asynchronous)
blocking send: the sending process is blocked until the message is received by the receiving process or by the mailbox
nonblocking send: the sending process sends the message, and resumes operation
blocking receive: the receiver blocks until a message is available
nonblocking receive: the receiver retrieves either a valid message or a null, and resumes operation
FCB的内容:
Process state
Program counter
CPU registers
CPU scheduling information
Memory-management information
Accounting infor
显示全部