notes for csapp

As demand on the CPU increases, processes slow down in some reasonably smooth way----多进程共享cpu,当对cpu的要求增长时,进城运行速度就会慢下来,因为大家都要使用cpu


This notion of mapping a set of contiguous virtual pages to an arbitrary location in an arbitrary file is known as memory mapping---map   virtual pages to  files The CR3 register contains the physical address of the L1 page table----对page table的访问使用物理地址,不经过mmu转换了


Reducing latency by deferring work. Sometimes, applications can use concurrency to reduce the latency of certain operations by deferring other operations and performing them concurrently.  For example, a dynamic storage allocator might reduce the latency of individual free operations by deferring coalescing to a concurrent “coalescing” flow that runs at a lower priority, soaking up spare CPU cycles as they become available.--------free时必调coalescing修成成单独的coalesing进程来完成


The threads are scheduled automatically by the kernel. Each thread has its own thread context, including a unique integer thread ID (TID), stack, stack pointer, program counter, general-purpose registers, and condition codes(执行执行后的状态码). All threads running in a process share the entire virtual address space of that process.


Each thread shares the rest of the process context with the other threads. This includes the entire user virtual address space, which consists of read-only text (code),
read/write data, the heap, and any shared library code and data areas. The threads also share the same set of open files.


Logical flows based on threads combine qualities of flows based on processes and I/O multiplexing. Like processes, threads are scheduled automatically by the kernel and are known to the kernel by an integer ID. Like flows based on I/O multiplexing, multiple threads run in the context of a single process, and thus share the entire contents of the process virtual address space, including its code, data, heap, shared libraries, and open files.

The thread terminates implicitly when its top-level thread routine returns.----顶层函数调用底层函数,区分什么是top-level


A joinable thread can be reaped and killed by other threads. Its memory resources (such as the stack) are not freed until it is reaped by another thread. In contrast, a detached thread cannot be reaped or killed by other threads. Its memory resources are freed automatically by the system when it terminates.


We say that a variable v is shared if and only if one of its instances is referenced by more than one thread.---------变量在线程之间共享




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值