[试题] 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