In a system, suppose there is a process and a resource with only one instance.
Let us assume that the process holds the instance and requests the same instance of that resource. Will there be a deadlock? Under what circumstances?
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It only takes a minute to sign up.Sign up to join this community
Resources that can only be used by a single process at a time are usually protected by a lock. If the process that currently holds the lock attempts to acquire it a second time, what happens depends on the type of lock.
Thus, it depends on what semantics your locks have. You can build non-reentrant locks on top of reentrant locks or vice versa if all you have is the wrong kind for what you want to do.