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.
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.
Let's describe briefly about these two types of 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.
Without causing the computation to fail, a nonpreemptable resource is the one that can be taken away from its current owner.