CSE 131 Lecture Notes - Lecture 12: Mutual Exclusion, Freebsd
Document Summary
Ensure that at least one of the conditions for deadlock never occurs. Only the printer daemon uses printer resource. Avoid assigning resource when not absolutely necessary. As few processes as possible actually claim the resource. Require processes to request resources before starting. A process never has to wait for what it needs. A process may not know required resources at start of run. This also ties up resources other processes could be using. Processes will tend to be conservative and request resources they might need. Variation: a process must give up all resources before making a new request. Process is then granted all prior resources as well as the new ones. Problem: what if someone grabs the resources in the meantime - how can the process save its state. Halfway through its job, take away the printer. Forcibly take away memory pages, suspending the process. Process may be able to resume with no ill effects.