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.---------变量在线程之间共享