Reputation: 451
Can the condition when single process/thread is blocked trying to acquire the same mutex be called "deadlock"?
mutex_lock(&mutex) - success
...
mutex_lock(&mutex) - blocked, mutex not released
Seems as condition of "nonshearable resource" doesn't apply: here is only single process/thread so that no case of nonshearable resource hold and wait: here is only single process so that no wait for another process to release the requested resource
Upvotes: 4
Views: 2650
Reputation: 119
No, it's not a Deadlock.
Deadlock can arise if four conditions hold simultaneously.
With a single process, the Circular Wait condition can never be met, thus deadlock can never arise with a single process.
Upvotes: 2
Reputation: 104708
yes, that is considered, or would potentially* result in deadlock.
the term is not bound to threads or processes - but requests.
suppose your lock (mutex
) is not reentrant, and suppose your resource is locked when mutated, and that it is an error to mutate the resource from multiple sources. what happens when/if your single threaded process attempts to initiate a new mutation of the data within a mutation and the non-reentrant lock which is locked is requested to lock? deadlock
'potentially', because you have not specified exactly what type of mutex you are dealing with.
Upvotes: 2