Buffl

6

MS
von Martin S.

How can a system be designed so that deadlocks dont occur ie. the ealier conditions are never met?

Condition 1 (mutual exclusion):

• This condition cannot be made ineffective, since the mechanisms of mutual exclusion must exist to avoid synchronisation problems.

• However, mutual exclusion can be limited to what is absolutely necessary. ( he likelihood of a deadlock decreases)

• For example, separation between transmission of the print job and the printing process itself via printer spooler.

Condition 2 (hold and wait):

• A process has to make all its resource requests at one time. • The problem here:

1. Not all resources are needed all the time.

2. Granting such a large resource request takes longer, as some of the required resources may still be in use elsewhere

Condition 3 (no preemption):

2 variants

1. If a process is denied a resource request, it must release all resources used by itself. (All processes developers must know and observe this rule.)

2. The operating system can force a process to release a resource. This requires the ability to save and restore the current working state of the resource for the releasing process. (This is partly difficult to implement).

Condition 4 (circular wait):

• A linear order of the resource types is defined. • Processes may only request resources following this order.

• The problem here (similar to hold & wait):

1. Resources must already be requested that are not yet needed.

2. Granting such an early request can (unnecessarily) block the process if the resource is already being used.

Author

Martin S.

Informationen

Zuletzt geändert