# 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 <font color="orange">shared-memory</font> 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 > [name=dot] [time=Wed, Jan 22, 2020 2:01 PM] [HOME PAGE](/bKDZoNkrT9SOBnTvY_aj2Q?both) :notebook: {%hackmd theme-dark %} ###### tags: `OS` `CSIE`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up