1,025 views

3 Answers

1 votes
1 votes

Answer:

Yes, it is definitely possible to have a case where one process may hold all or some units of one resource type and require other resource types.

Example:

Two processes are both assigned the same memory cells in a real memory system. (Assume that the swapping of pages are not allowed). If a first process hold another resource ( data cell) and when the second resource request this data, it gets blocked. The first process requires more memory to execute code. (Assume no process can release or complete memory cell in the system), therefore a deadlock occurs.

0 votes
0 votes
Yes, it is possible and that is why it is called as deadlock resources, otherwise it won't be.

Let's suppose you have two processes both are executing at the same time and both are holding same memory in the system (memory is dynamic allocated). So, it can be possible that when the first process is using memory and that process is in non-preemption  mode then we can not put in other process in execution but at the same time second process is also trying to acquire the memory and at the same time two process running for single memory location and then processor can not decide which process gets memory for execution, "AND HERE YOUR DEADLOCK RESOURCE WOULD BE MEMORY WHICH IS NOT SHARED" and this happens bcz of bad allocation of memory to the processes and by not putting in a good synchronization technique.

 

if in this same condition, we are using good inter process communication and synchronization techniques, then it won't happen bcz by using those techniques we can make communication between processes and make other process in waiting state while other completes its execution, or we can also complete partially another process by using other resources, the resources which are not getting in use by first process.
0 votes
0 votes
It is possible that one process holds some or all of the units of one resource
type and requests another resource type, while another process holds the second
resource while requesting the available units of the first resource type. If
no other process can release units of the first resource type and the resource
cannot be preempted or used concurrently, the system is deadlocked.

Related questions

0 votes
0 votes
0 answers
2
1 votes
1 votes
1 answer
4