Dinning-philosphers problem, solution using counting semaphore and fair scheduling

Robert P. J. Day rpjday at crashcourse.ca
Mon Oct 21 08:43:50 EDT 2013


On Mon, 21 Oct 2013, Kumar Amit Mehta wrote:

> Hi All,
>
> This query is not about linux kernel in any way, but rather is a
> very primitive question on scheduling and resource management
> principles, using the dinning-philosphers analogy. I assume, most of
> the people here would have faced such situation and hence thought of
> discussing this in this forum. Also, i think, learning such basic
> principle will help me understand the scheduling algorithms.
>
> I also assume that every computer science student would have come
> across this classical problem of dinning philosphers problem[1],
> proposed by Dijkstra. I came across it long back but i never took it
> seriously, Now I have revisited this same topic and was wondering if
> using a counting semaphore with completely fair scheduling will
> solve both of the deadlock and starvation situations.

  the standard solution is to simply order the resources and require
everyone to request resources in that order. problem solved. don't
make this into a bigger issue than it really is.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



More information about the Kernelnewbies mailing list