デッドロックの説明として, 適切なものはどれか。
平成24年度 秋期 ITパスポート試験 問67
This question's explanation and your answers so far.
問 67
Incorrectア
This describes access control (access-right management and memory protection). It refers to a mechanism in which the OS decides whether access is permitted based on privileges, so that a process cannot touch information it originally has no right to, or the memory area of another process. Its purpose is to ensure confidentiality and safety, which is an entirely different concept from waiting for a resource to be released or from processing coming to a stop. A deadlock is a waiting problem that arises over resources the processes are entitled to, so this description does not fit.
Incorrectイ
This describes account lockout. It refers to a security function that, when the number of wrong password entries during user authentication reaches a prescribed count, makes that user's account unusable for a certain period or until an administrator releases it, thereby preventing unauthorized logins by brute-force attacks and the like. It is easy to confuse because it contains the same word lock, but what it targets is a user account, and it has nothing to do with processes competing over resources.
- ウ
正解 The correct answer is ウ. A deadlock is a state in which, when multiple processes use shared resources under exclusive control (exclusive use), each process keeps holding the resource it has acquired while waiting for the resource held by the other process to be released, so that no process can ever move its processing forward. As a typical example, consider this: process A locks resource X and then requests resource Y, while at the same time process B locks resource Y and then requests resource X. A waits for B to let go of Y, and B waits for A to let go of X, so the waiting relationship becomes circular and both stop while waiting. This circular wait, in which each is waiting for the resource occupied by the other process to be released, is the very essence of a deadlock, and the statement in ウ describes exactly that. The same thing occurs in a database when multiple transactions lock the same row or the same table in opposite orders. A deadlock does not clear up by itself if left alone, so it is dealt with by prevention, detection, and recovery mechanisms such as unifying the order of resource acquisition across the whole system, acquiring all the necessary resources at once, or cutting off the wait after a fixed time and making one side roll back (re-execute).
Incorrectエ
This describes a timeout, that is, a process using up the CPU time (time quantum) allocated to it under a scheme such as round robin and being returned from the running state to the executable state (being preempted). In this case the process runs again once its turn comes around, so its processing does not stop forever. It is a matter of controlling the allocation of CPU time, not a description of a deadlock, which is a state of waiting for each other to release resources.
- Definition of a deadlock — a state in which multiple processes each keep holding resources under exclusive control while waiting for the resources occupied by the other processes to be released, falling into a circular wait so that processing never moves forward. It is prevented and recovered from by unifying the order of resource acquisition, acquiring all resources at once, or rolling back one side by means of a timeout.
- Distinguish the confusable terms for states in which something stops — access control is a protection function that prohibits access to information one has no right to, account lockout is a function that makes a user unusable after repeated authentication failures, and a timeout (preemption) is a return to the executable state after using up the allocated CPU time. Only a deadlock waits forever.