看板 Grad-ProbAsk 關於我們 聯絡資訊
※ 引述《jack0602 (21)(21)》之銘言: : [1]After a user program starts an I/O operation, it has to wait for : the completion of the I/O operation to resume its program execution. : 此題要選對的 這是其中一個選項 但答案卻沒有選 : 是否和nonblocking和asynchronous system call有關呢? : [2]有關thread pool : 1.想請問當有人要一條thread 且thread pool有一條available的 : 那當該條thread被要走後 該條thread是還在thread pool中但not available : 還是不在thread pool中呢? : 我看到恐龍書有句寫Once the thread completes its service, it returns : to the thread pool.所以應該算是不在嗎? : 2.Only when a thread finishes and leaves the pool, we can allow new : threads to enter the pool. : 答案寫此敘述是對的 沒寫原因 : 恐龍書寫thread pool的地方也沒看到有關的描述 : 但根據1.提到恐龍書的描述 當有一個thread finishes : 不是應該returns to the thread pool嗎? 為什麼會寫leave呢? : 還是是說thread finishes後也有可能把memory還給系統的意思呢? : 3.A preemptibe CPU scheduler may choose a thread to leave the thread : pool before the thread finishes. : 此敘述是錯的 同樣對leave有疑問 若暫且假設2.的最後一句是對的 : 此外 這項敘述似乎也代表著1.提到的疑問是thread使用時還在thread pool? : 是否把leave the thread pool改成block this thread就正確了呢? : 4.In Many-to-Many model, the number of kernel threads can be specific : to either a particular application or a particular machine. : 此敘述是對的 但我看不懂它的意思...... : [3]Response time : 假設Process Pi在t=1時到達 t=3時開始做 t=6時被較高Priority的Process插隊 : 則Pi的Response time是3-1=2 還是6-1=5 或是都不對呢? thread pool裡面的thread被分配之後,還是會在thread pool中,只是就是去執行了,當 執行完成之後,就會類似process,正常的terminate,並且類似process消失,只是系 統在知道這個thread消失之後,就馬上create一個進去pool,所以Only when a thread f inishes and leaves the pool, we can allow new threads to enter the pool.這句話 是對的,然後恐龍的措詞可能不好,不是return,而是馬上創造一個。 A preemptibe CPU scheduler may choose a thread to leave the thread pool before the thread finishes. 如果這樣思考,那這個就是錯的。因為搶奪的排程顯然不能殺死thread。 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.120.228.19 ※ 編輯: A4P8T6X9 來自: 140.120.228.5 (03/16 16:32)