What is Concurrency? Expain with example Deadlock and
Starvation?

Answers were Sorted based on User's Feedback



What is Concurrency? Expain with example Deadlock and Starvation?..

Answer / preeti

Deadlock:

Two processes are said to be in deadlock situation if
process A holding onto resources required for process B and
where as B holding onto the resources required for process
A.

Starvation:

This is mostly happens in time sharing systems in which the
process which requires less time slot is waiting for the
large process to finish and to release the resources, but
the large process holding the resources for long time
(almost for forever) and the process that requires small
time slot goes on waiting. Such situation is starvation for
small process

Is This Answer Correct ?    41 Yes 6 No

What is Concurrency? Expain with example Deadlock and Starvation?..

Answer / @pravin.08

hi!
concurrency is the property of systems in which several
processes running simultaneously,interacting with each other.

Deadlock:In multiprogramming environment,several processes
may compete for limited no. of resources,a process request
resources n if resources are not available at moment ,process
enters a waiting state.sometimes ,a waiting process never
able to change it's state,becoz the resources it has
requeseted are held by other process.such type situation is
called DEADLOCK.

Starvation:a situation in which a process wait indefinetly.

Is This Answer Correct ?    7 Yes 4 No

What is Concurrency? Expain with example Deadlock and Starvation?..

Answer / rajdeo kumar vadhwa

concurrency:-
when two processes want to acquire the same resource.

Deadlock:-
Deadlock is a condition when two processes (A,B)require a
single resource at a moment then deadlock condition occurred.
example:
suppose two process A,B require resource 'R' for accessing
and that time process A and B both generate flag 1 for
acquire the resource in this situation no one can access
that resource immediately then deadlock condition occurred.


Starvation:
This is mostly happens in time sharing systems in which the
process which requires less time slot is waiting for the
large process to finish and to release the resources, but
the large process holding the resources for long time
(almost for forever) and the process that requires small
time slot goes on waiting. Such situation is starvation for
small process.

Is This Answer Correct ?    5 Yes 2 No

What is Concurrency? Expain with example Deadlock and Starvation?..

Answer / ayu

WHAT IS A STARVATION INTRODUCTION (OPERATING SYSTEM)

Is This Answer Correct ?    12 Yes 11 No

What is Concurrency? Expain with example Deadlock and Starvation?..

Answer / manoj

Deadlocks and Starvation
Readings: Chapter on Deadlocks in Tanenbaum. You can skip
Deadlock
Detection and Banker’s Algorithm.
· We looked at solving synchronization problems using
monitors and
semaphores.
· Unfortunately, problems can arise
Example 1:
Recall our solution to the reader-writer problem. It was
possible for
readers to wait indefinitely if new writers kept coming in.
On the other hand, writers would not wait indefinitely as
long as ready
threads are served in order.
Why?Thread A Thread B
lock(x)
lock(y)
Use resource X and Y
Unlock(y)
Unlock(x)
Lock(y)
Lock(x)
Use resource X and Y
Unlock(x)
Unlock(y)
In this case, it is possible that both Thread A and Thread B
wait
indefinitely for each other, with no progress being made.
What is common and different between the above examples?
Common aspect: Both problems involve threads waiting for
resources to
become available. They can also involve
· Resources: things needed by a thread to do its job a
thread *waits*
for resources
o e.g., locks, AW+WW = 0 (i.e., database is free from active or
waiting writers), disk blocks, memory pages
· Indefinite wait: In both examples, a thread may end up waiting
indefinitely.
Differences between the two examples: The type of waiting is
different.
· Starvation
A thread may wait indefinitely because other threads keep coming
in and getting the requested resources before this thread
does. Note that
resource is being actively used and the thread will stop
waiting if other
threads stop coming in.
· Deadlocks
A group of threads are waiting for resources held by others
in the
group. None of them will ever make progress.
Example 1 has starvation, but Example 2 does not.
A solution to a synchronization problem suffers from the
starvation
problem if starvation is a possibility. Usually, differences
in priorities can
lead to starvation. Lower priority threads starve if higher
priority threads
keep requesting the resources.
A solution suffers from the deadlock problem if a deadlock
is a possibility.
In Example 2, will a deadlock always occur?

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More Operating Systems General Concepts Interview Questions

What resources are used when a thread created? How do they differ from those when a process is created?

0 Answers  


Can you tell me the difference between semaphore and mutex.

0 Answers  


What are the different states of a process?

0 Answers  


Explain the characteristics of instruction and execution time.

0 Answers  


What is the best page size when designing an operating system?

0 Answers  






Which is first operating system?

0 Answers  


What are the different synchronization mechanisms?

0 Answers  


What are the different types of fragmentation?

0 Answers  


How much ram can 64 bit use?

0 Answers  


Which vpn protocol is best?

0 Answers  


How do I find the location of an excel file?

0 Answers  


How do I delete an operating system?

0 Answers  


Categories