Program、Process、Thread?


  1. Program 指尚沒有被 Load 到 Main Memory 的一堆 Code,存放在Secondary Storage Devices 中。
  2. Process
  3. Thread

Threads簡介


Threads

  1. 又名 lightweight process

  2. 是使用 CPU 的最小單位

  3. 是分配CPU Time的單位

  4. 同一 Process 內的 thread 共享資源

  5. thread 擁有以下內容 :

    process 內的 threads 彼此共享 :

    (Code section + Data section = memory space, Address space, Heap memory)

    multithread.png

    Multi-threading vs Multi-processing


multiprocess_multithread-e1713309755479.png

Motivation


web browser