OS Deadlock Resources

Deadlocks can occur whenever processes have been granted exclusive access to computer devices, files, etc.

A resource can be a computer hardware device or a piece of information.

Generally, a computer have many resources that can be acquired.

You can also say that a resource is anything that can be used by only a single process at any instant of time.

Here is the sequence of events that are required to use a resource.

  • Request the resource
  • Use the resource
  • Release the resource

In case, if a resource is not available when it is requested, the requesting process is forced to wait.

In some OS, the process is automatically blocked whenever a resource request fails and awakened when it becomes available. And in other OS, the resource request fails with an error code and it is up to the calling process to wait a little while and then try again.

There are the following types of resources.

  • Preemptable Resources
  • Nonpreemptable Resources

Let's describe briefly about these two types of resources.

Preemptable Resources

A preemptable resource is the one that can be taken away from the process owning it with no ill effects.

An important and common example of preemptable resource is memory.

Nonpreemptable Resources

Without causing the computation to fail, a nonpreemptable resource is the one that can be taken away from its current owner.

Operating System Online Test

« Previous Tutorial Next Tutorial »

Like/Share Us on Facebook 😋