운영체제 연습문제 4장
- 최초 등록일
- 2010.09.29
- 최종 저작일
- 2010.04
- 4페이지/ 한컴오피스
- 가격 1,000원
소개글
운영체제 연습문제 4장 조선대학교 이준 교수님꺼
목차
없음
본문내용
4.1 Provide two programming examples in which multithreading does not
provide better performance than a single-threaded solution
Answer: (1) Any kind of sequential program is not a good candidate
to be threaded. An example of this is a program that calculates an individual
tax return. (2) Another example is a "shell" program such as
the C-shell or Korn shell. Such a program must closely monitor its own
working space such as open files, environment variables, and current
working directory.
4.2 Describe the actions taken by a thread library to context switch between
user-level threads.
Answer: Context switching between user threads is quite similar to
switching between kernel threads, although it is dependent on the
threads library and how it maps user threads to kernel threads. In
general, context switching between user threads involves taking a user
thread of its LWP and replacing it with another thread. This act typically
involves saving and restoring the state of the registers.
4.3 Under what circumstances does a multithreaded solution using multiple
kernel threads provide better performance than a single-threaded
solution on a single-processor system?
23
24 Chapter 4 Threads
Answer: When a kernel thread suffers a page fault, another kernel
thread can be switched in to use the interleaving time in a useful manner.
A single-threaded process, on the other hand, will not be capable of
performing useful work when a page fault takes place. Therefore, in
scenarios where a program might suffer from frequent page faults or
참고 자료
없음