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

how does a virus infect the system

8 Answers   LK, Sutherland,


In a ram description ddr 2 1066mhz “2.5-3-3-8” what do the numbers in quotes signify?

0 Answers  


when a process is created using fork(). what is shared between parent process and child process. 1.Heap 2. stack 3. shared memory segments 4. I/O handles

2 Answers   Hyderabad Central University, nvidia,


A pair of redundant systems are operating, how would you ensure that when one of them goes down, the other one will take over its operation?

0 Answers   DELL,


What are the main difference between Micro-Controller and Micro- Processor?

1 Answers  






What are the functions of operating system?

0 Answers  


What is the purpose of using the yield method of thread class?

0 Answers  


How many stages are there in chkdsk?

0 Answers  


How can a vfs layer allow multiple file systems support?

0 Answers  


What is run level 1?

0 Answers  


For a deadlock to occur what are the necessary conditions

0 Answers  


How to find the number of sockets created in your system?

1 Answers   CA,


Categories