Examly題庫立即開始練習
原住民族考試四等考試-電子工程類科計算機概要1137單選題

當一個 process 包含多個 threads 時,下列資料何者不是多個 thread 共享?①register values ②global variables ③stack memory ④heap memory

A①②
B①③正確答案
C③④
D②④
答案與詳解
B
正確答案
Thread 共享 process 的 code、data(global)、heap;但 register 和 stack 每個 thread 各自獨立。

為什麼答案是 B

① 每個 thread 有自己的 register(含 PC、SP 等執行狀態);③ 每個 thread 有獨立 stack 保存區域變數與呼叫紀錄。兩者皆 thread 私有,正解。

考點:global 共享考點:thread 私有資源考點:heap 共享考點:概念顛倒
載入中…

想練更多計算機概要考古題?

Examly 收錄 38 萬+ 道歷屆題目,每題都有像這樣的精選詳解。免費下載,立即開練。

Download on theApp Store即將推出Google Play
黑皮