운영체제 공룡책(operating system)8판 7장 연습문제
*보*
다운로드
장바구니
목차
7.4 Consider the traffic deadlock depicted in 7.9. (7.9에 보인 교통의 교착상태를 생각해보자.)7.7 Consider the following resource- allocation policy. Requests for and releases of resources are allowed at any time. If a request for resources cannot be satisfied because the resources are not available, then we check has the desired resources, then these resources are taken away from it and are given to the requesting process. The vector of resources for which the blocked process is waiting is increased to include the resources that were taken away. For example, consider a system with three resource types and the vector Available initialized to (4,2,2). If process P0 asks for (0,0,1), it available one (1,0,0) and one that was allocated to P0 (since P0 is blocked). P0's Allocation vector goes down to (1,2,1), and its Need vector goes up to (1,0,1). (다음의 자원 할당 정책을 고려해 보자. 자원에 대한 요청과 할당은 언제나 가능하다. 자원이 사용 가능하지 않아서 자원에 대한 요청이 충족될 수 없다면, 우리는 자원을 기다리며 봉쇄된 프로세스들을 검사한다. 만약 이들이 원하는 자원을 가지고 있으면, 이들 자원들을 회수해 요청 프로세스에게 공급한다. 대기 프로세스가 기다리는 자원들의 벡터가 회수된 자원을 포함하기 위해 증가된다. 예를 들어, 3개의 자원 타입과(4, 2, 2,)로 초기화된 벡터 가용(Available)을 가진 시스템을 고려해 보자. 프로세스 P0가 (2, 2, 1)을 요청하면, 이들을 즉시 얻을 수 있다. 만약 P1이 (1, 0, 1)을 요청하면, 이들을 얻을 수 있다. 그 후 P0가 (0, 0, 1)을 요청하면, 이용 가능한 자원이 없기 때문에 봉쇄된다. 만약 P2가 이제 (2, 0, 0)을 요청하면, 가용한 (1, 0, 0)과 P0에 할당된 것 하나를 획득한다(P0가 봉쇄되어 있으므로). P0의 할당(Allocation) 벡터는 (1, 2, 1)로 내려가고, 이것의 요구(Need) 벡터는 (1, 0, 1)로 올라간다.)
7.10 Consider the following snapshot of a system: (현재 시스템의 상태가 아래와 같다)
7.11 Consider a system consisting of m resources of the same type being shared by n processes. A process can request or release only one resource at a time. Show that the system is deadlock free if the following two conditions hold: (n개의 프로세스들이 공유하는 동일한 타입의 자원 m개로 구성한 시스템을 고려해 보자. 자원들은 단지 한 번에 한 개씩 프로세스들에 의해 요청되고 방출될 수 있다. 다음의 두 조건이 성립하면, 시스템이 결코 교착상태가 될 수 없음을 설명하시오.)
7.14 What is the optimistic assumption made in the deadlock-detection algorithm? How can this assumption be violated? (교착상태 탐지 알고리즘은 어떤 낙관적인 가정을 하고 있는가? 이 가정은 어떤 경우에 위배될 수 있는가?)
본문내용
7.4 Consider the traffic deadlock depicted in 7.9. (7.9에 보인 교통의 교착상태를 생각해보자.)a. Show that the four necessary conditions for deadlock hold in this example. (이 예에서 교착상태를 위한 네 가지 필요조건이 정말로 성립함을 보이시오.)
= 상호 배제 - 단 하나의 자동차가 도로에서 공간을 차지.
(상호배제 조건은 찻길에서 단 한대의 자동차만이 점유할 수 있는 있는 것입니다.)
= 점유하며 대기 - 한 차량이 도로에서 그들의 자리를 지키는 곳에서 나타남.
(점유대기는 앞서가려고 기다리면서 길 위의 자리에서 멈춰있는 곳에서 발생합니다.)
= 비선점 - 자동차는(점유된) 길 위의 그 자리에서 제거될 수 없음.
= 순환대기 - 순환대기는 각 차량이 차후의 차량이 전진하기를 대기하는 것.
(각각의 차량이 뒤이어 오는 자동차가 앞서 나가기를 기다리는 순환대기가 있습니다.)
b. State a simple rule for avoiding deadlocks in this system. (이 시스템에서 교착상태를 회피하는 간단한 법칙을 설명하시오.)
= 교차로가 원활하지 않을 때 자동차가 교차로로 진입하지 않는 것.