Try   HackMD

Threading Issues

Implicit Threading

  • thread 由 compiler 和 run-time library 建立和管理
  • 常見方法
    • Thread pools
    • OpenMP
    • Grand Central Dispatch
    • TBB(Threading Building Blocks)

Thread Pools

  • 預先建立一些 thread 等待 work
  • 優點
    • 預先建立好,速度較快
    • 執行 thread 的數量被 pool 的大小限制

OpenMP

  • Provides support for parallel programming in shared-memory environment
  • Can identify parallel regions which can run in parallel

Grand Central Dispatch

  • Apple technology for Mac OS and iOS operating system
  • Allow identification of parallel sections

Signals

  • 當某事件(event)發生時會產生signal
  • signal會被傳送給process
  • 兩種處理方式
    • default
    • user-defined(會覆蓋掉default)

Thread Cancellation

  • 在 thread 完成前終止它
  • 兩種方法
    • Asynchronous cancellation
      • 立即中止
    • Deferred cancellation
      • 一個時間週期到了才會被取消
  • 一般預設是 Deferred cancellation
  • 若 thread 的 state 是 disabled (不給取消),則取消請求一直 pending 到 enabled

Scheduler Activation

  • 在 M:M 和 Two-level 中,維持適當的 kernel thread 數量,再分配給程式
  • LWP (Light Weight Process)
    • 一種資料結構,提供虛擬行程的排程

last edit

dotWed, Jan 22, 2020 2:01 PM

HOME PAGE

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

tags: OS CSIE