Different Solutions to dining philosophers problem.

Answer Posted / anubhav agrawal

One solution would be to banish a philosopher from the
table, thus emptying a seat. This leaves five chopsticks
for four people, so at least one of the philosophers will
be able to eat; thus, no deadlock. This means that each
system must have more resources available than tables, in
essence.

Another solution is to say that a philosopher can only pick
up chopsticks if both are available, and then only if the
neighbors are not going to pick them up. This is a
permissive style that causes some extra slowdown by adding
the step of permissions, but it keeps all of the
philosophers alive, which is the most important thing.

A third solution is an asymmetric one: number the
philosophers starting at an arbitrary chair and continuing
around the table. Then, a philosopher with an odd number
picks up the left chopstick and then the right, and the
even numbered philosophers pike up the right chopstick and
then the left. Thus, philosophers 2, 3, and 4 only can be
missing a pair if one of the two people at their sides are
actually eating (not just waiting), thus making sure a
deadlock is impossible.

There are countless more possible solutions to the dining-
philosophers problem. The primary factor in deciding if a
solution is good or not is to make sure that there are no
deadlocks or long pauses in the procedure; in other words,
a good solution makes sure a philosopher doesn't starve to
death.

Solutions to this problem show up regularly in all sorts of
areas, from biology to psychology to computer science. The
problem of synchronization is a fundamental one in our
world, and the dining-philosophers problem addresses it
simply, clearly, and directly

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Outline and discuss the main fields in Ethernet IEEE 802.3 frame. What are the main objectives of preamble ?

1427


What are the principles that were applied to arrive at the seven layers in OSI model?

2776


what is scsi?. what we do if scsi/scsi drive failed?.

1884


which is the latest version of dos? & what is the command to copy windows files (i386) without formatting OS?

1600


What is ISO-OSI reference model ? Compare it with TCP/IP reference model.

1253






What is redirector

828


What are the other names of IEEE 802.11 protocol or standard?

1128


whtch file system support the tcp/ip , http protocal and ftp protocal?

1798


Subnet the class C network address 198.67.25.0 into eight subnets. Why are the ‘all ones’ and ‘all zeroes’ subnets not used ?

1388


When creating a static route, what is the gateway used to define?

1533


Explain network equipment used in wired-LANS and explain the function of Hub, Switch, and bridge.

1311


Explain any three error detection and correction techniques.

1251


Which layer is used to run services like FTP, Telnet etc.

1450


What is autonomous system

735


What are the various classes of IP addressing? Calculate the maximum number of class A, B and C network Ids.

1212