Skip to content

7月4日 计算机体系结构和高性能计算基础#

Overview#

  • ISA and x86 Instructions
  • Processor Architecture
  • Memory Hierarchy
  • Concurrency Basic

Prerequisite Checklist#

  • Digital representation of values
  • Memory & Address
  • C code

ISA & x86 instruction#

  1. ISA: instruction ser architecture.
  2. Assembly Language

Processor Architecture#

  1. Microarchitecture is implementation.(could make faster)
  2. thread(线程)
  3. fetch -> Decode -> Execute -> Commit
  4. Data hazards: You haven't already written but the next process need to call the data.
  5. control hazard: parallel processing could make a fault.
  6. structure hazard : like fetch and execute could make conflict.
  7. SRAM & DRAM:SRAM = cache(高缓冲).

Memory Layout#

  1. Stack: Runtime stack (8MB limit) local variables.
  2. Heap: Dynamically allocated as needed.
  3. Data: statically allocated data.
  4. virtual memory: OS utilizes virtual memory to isolate address space of different processes and provide each process the same linear address space(线性映射,类似于哈希)
  5. Translation Lookaside buffer(TLB) -> could accelerate the virtual memory and physical memory interactive.
  6. NVM: between SSD and SRAM.
  7. Cache Organization(valid bit; dirty bit ; Tag: check if matching)
  8. Cache usage : Read hit ; Read miss ; Write hit(write-back); Write miss(write-allocate)
  9. Multiple Cache Hierarchy。(L1 L2 L3)
  10. Processes vs. Threads.

differences: Threads in one process share memory but processes not.

//当两个线程一块进行这个代码时,最小的计算结果是2,思考为什么?
for(int i=1; i < 10000; i++)
{
    counter++;
}

x86 microarchitecture#


Last update: 2023年9月27日 10:52:36
Created: 2023年7月6日 23:32:03