오퍼레이팅 시스템 부분 연습문제( 1~4 장)
*경*
다운로드
장바구니
소개글
오퍼레이팅 시스템7판 (공룡그림) 부분 연습문제 입니다.목차
1장 5,7,8,9,122장 1,2,5,6,10,11
3장 1,2,5
4장 2,3,4,5,8
본문내용
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 Which of the following components of program state are shared across thread in a multithreaded process?
a. Register values
b. Heap memory
c. Global variables
d. Stack memory
<Answer>
d. Stack memory
4.4 Can a multithreaded solution using multiple user-level threads achieve better perfomance on a multiprocessor system than on a single processor system?
<answer>
그렇다. 단일 프로세스 모델에서는 첫 번째 프로세스가 블록해제 될 때까지 다른 어떤 서버 프로세스도 수행될수 없다. 반면에 다중 스레드를 가진 작업의 경우에는 하나의 서버 스레드가 블록되고 대기하는 동안 같은 작업내의 다른 두 번째 스레드가 수행될 수 있다. 이같은 작업의 한부분을 다중 스레드들이 협력하는것은 처리율및 효율증진 측면에서 커다란 장점이 될수 있다. 또한 최대 효율을 위해 두 개이상의 프로세서상에서 병렬처리 될수 있다는 장점도 있다.
여기에 몇가지 예가 있다
(1) A Web server that services each request in a separate thread.
(2) A parallelized application such as matrix multiplication where different parts of the matrix may be worked on in parallel.
(3) An interactive GUI program such as a debugger where a thread is used to monitor user input, another thread represents the running application, and a third thread monitors performance.
4.5 The program shown in figure 4.11 uses the Pthreads API. What would be output from the program at LINE C and LINE P?
<answer>
#include <pthread.h>
#include <stdio.h>
int value=0;
void *runner(void *param);
int main(int argc, char *argv[])
{
int pid;
pthread_t tid;
pthread_attr_t attr;
pid=fork();
if(pid==0){
pthread_attr_init(&attr);
pthread_create(&tid,&attr,runner,NULL);
pthread_join(tid,NULL);
printf(
참고 자료
operating system concept 6판operating system 7판
압축파일 내 파일목록
오퍼레이팅/
오퍼레이팅/1장연습문제.hwp
오퍼레이팅/2장 연습문제.hwp
오퍼레이팅/3장연습문제.hwp
오퍼레이팅/4장 연습문제.hwp
오퍼레이팅/1장연습문제.hwp
오퍼레이팅/2장 연습문제.hwp
오퍼레이팅/3장연습문제.hwp
오퍼레이팅/4장 연습문제.hwp