随笔分类 -  Computer System

摘要:1 a thread-unsafe code version: 1.1 correct version 1: 1.2 correct version 2 and its pros and cons: Another approach is to pass the integer i directly 阅读全文
posted @ 2018-08-04 13:30 geeklove 阅读(522) 评论(0) 推荐(0)
摘要:Using Threads for Parallelism Figure 12.30 shows the set relationships between sequential, concurrent, and parallel programs. A parallel program is a 阅读全文
posted @ 2018-08-03 17:00 geeklove 阅读(286) 评论(0) 推荐(0)
摘要:Using Semaphores to Schedule Shared Resources In this scenario, a thread uses a semaphore operation to notify another thread that some condition in th 阅读全文
posted @ 2018-07-29 19:07 geeklove 阅读(231) 评论(0) 推荐(0)
摘要:Shared Variables in Threaded Programs Threads Memory Model Thus, registers are never shared, whereas virtual memory is always shared. The memory model 阅读全文
posted @ 2018-07-27 12:13 geeklove 阅读(331) 评论(0) 推荐(0)
摘要:Modern operating systems provide three basic approaches for building concurrent programs: Processes. With this approach, each logical control flow is 阅读全文
posted @ 2018-07-25 17:15 geeklove 阅读(259) 评论(0) 推荐(0)
摘要:It is important to realize that clients and servers are processes and not ma- chines, or hosts as they are often called in this context. Data received 阅读全文
posted @ 2018-07-24 18:13 geeklove 阅读(201) 评论(0) 推荐(0)
摘要:An input operation copies data from an I/O device to main memory, and an output operation copies data from memory to a device. All language run-time s 阅读全文
posted @ 2018-07-23 20:11 geeklove 阅读(330) 评论(0) 推荐(0)
摘要:Working within these constraints, the author of an allocator attempts to meet the often conflicting performance goals of maximizing throughput and mem 阅读全文
posted @ 2018-07-21 13:18 geeklove 阅读(266) 评论(0) 推荐(0)
摘要:The execve Function Revisited Suppose that the program running in the current process makes the following call: Execve("a.out", NULL, NULL); Loading a 阅读全文
posted @ 2018-07-20 13:13 geeklove 阅读(300) 评论(0) 推荐(0)
摘要:Linux organizes the virtual memory as a collection of areas (also called segments). An area is a contiguous chunk of existing (allocated) virtual memo 阅读全文
posted @ 2018-07-13 16:12 geeklove 阅读(622) 评论(0) 推荐(0)
摘要:Integrating Caches and VM TODO peeding up Address Translation with a TLB Many systems try to eliminate even this cost by including a small cache of PT 阅读全文
posted @ 2018-07-12 19:45 geeklove 阅读(553) 评论(0) 推荐(0)
摘要:Page Hits: CPU reads a word of virtual memory which is cached in DRAM. Page Faults(缺页): 流程: 术语: Virtual memory systems use a different terminology fro 阅读全文
posted @ 2018-07-08 15:43 geeklove 阅读(418) 评论(0) 推荐(1)
摘要:Synchronizing Flows to Avoid Nasty Concurrency Bugs an example code: void handler(int sig) { pid_t pid; while ((pid = waitpid(-1, NULL, 0)) > 0) /* Re 阅读全文
posted @ 2018-07-08 12:48 geeklove 阅读(201) 评论(0) 推荐(0)
摘要:example codes: if (errno != ECHILD) unix_error("waitpid error");//Version 4 code in purple, same with version 2 if (errno != ECHILD) unix_error("waitp 阅读全文
posted @ 2018-07-07 19:04 geeklove 阅读(301) 评论(0) 推荐(0)
摘要:A signal that has been sent but not yet received is called a pending signal. At any point in time, there can be at most one pending signal of a partic 阅读全文
posted @ 2018-07-07 12:41 geeklove 阅读(171) 评论(0) 推荐(0)
摘要:Putting Processes to Sleep The sleep function suspends a process for a specified period of time. Sleep returns zero if the requested amount of time ha 阅读全文
posted @ 2018-07-04 18:59 geeklove 阅读(236) 评论(0) 推荐(0)
摘要:Process Control Obtaining Process IDs Each process has a unique positive (nonzero) process ID (PID). The getpid function returns the PID of the callin 阅读全文
posted @ 2018-07-03 13:07 geeklove 阅读(270) 评论(0) 推荐(0)
摘要:Processes The classic definition of a process is an instance of a program in execution. Each program in the system runs in the context of some process 阅读全文
posted @ 2018-07-01 17:35 geeklove 阅读(263) 评论(0) 推荐(0)
摘要:Faults Faults result from error conditions that a handler might be able to correct. When a fault occurs, the processor transfers control to the fault 阅读全文
posted @ 2018-06-30 19:22 geeklove 阅读(236) 评论(0) 推荐(0)
摘要:different levels of ECF: In general, we refer to these abrupt changes as exceptional control flow (ECF). Exceptional control flow occurs at all levels 阅读全文
posted @ 2018-06-30 17:58 geeklove 阅读(289) 评论(0) 推荐(0)