[試題] 105上 鄭卜壬 系統程式設計 期中考

作者: xavier13540 (柊 四千)   2016-11-23 13:16:03
課程名稱︰系統程式設計
課程性質︰資訊工程學系大二必修
課程教師︰鄭卜壬
開課學院:電機資訊學院
開課系所︰資訊工程學系
考試日期(年月日)︰2016/11/16
考試時限(分鐘):180
試題 :
1. (17 pts) Explanation (as clearly as possible for full credits).
(a) (4 pts) System calls allow processes to trap into the kernel. Give two
examples of system calls to explain under what circumstances one would
trigger a context switch and the other would not.
(b) (3 pts) Explain under what circumstances advisory lock is safe even
though there are other processes probably violating a lock and trying to
access the locked file.
(c) (3 pts) Explain why communication through a pipe should be limited to
processes that descend from a common ancestor.
(d) (3 pts) Exaplain under what circumstances a UNIX-like system would
automatically turn off the set-group-ID bit of a newly created file.
(e) (4 pts) Explain why it's common for a process to create and open a new
file and then immediately unlink it; however, it's not very useful for a
process to create and open a directory and then immediately remove it.
2. (20 pts) The cp utility copies the content of a source file to a target file.
When cp implemented with unbuffered I/O system calls, the following four
factors (A)~(D) would significantly affect its execution time. Please answer
the questions.
(A) The number of the while loops

Links booklink

Contact Us: admin [ a t ] ucptt.com