Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Feb 1998 13:55:31 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        y-carden@uniandes.edu.co (Yonny Cardenas Baron)
Cc:        hackers@FreeBSD.ORG, questions@FreeBSD.ORG
Subject:   Re: Philosophers
Message-ID:  <199802161355.GAA08438@usr01.primenet.com>
In-Reply-To: <Pine.SOL.3.96.980216055715.1720A-100000@isis.uniandes.edu.co> from "Yonny Cardenas Baron" at Feb 16, 98 05:58:27 am

next in thread | previous in thread | raw e-mail | index | archive | help
> I  need a  program in c, whith the solution the Dijkstra's problem
> philosophers eating, using 
> semaphores in UNIX, (FreeBSD). 
> 
> I can find it ? 
> 
> Thanks for your help. 

This is probably a classroom assignment on deadlock avoidance, but
I'll help you anyway.  Here is Dijkstra's own soloution:

	http://www.cstp.umkc.edu/~hines/431/deadlock_avoid.html
	http://www.ececs.uc.edu/~imutaban/miniproject/Bankers/index.html

Here is a more general reference:

	http://www.sct.edu/cs/classes/cs503/ops5.htm

And here is how you should do it, according to best known practice:

	http://www.eecs.umich.edu/~qstout/abs/BR93ccc.html
	http://www.eecs.umich.edu/~qstout/abs/SPAA93ultra.html

Note: Dijkstra's algorithm is a "priority-first search soloution" for a
sparse graph.  Best known practice is more concurrent than Dijkstra's
banker's algorithm, but requires an undestanding of graph theory in
general and Hamiltonian cycles, in particular.

Note also that Dijkstra's algorithm is rather antiquated.  It was first
published in the literature in 1957.

The current BSD lockmgr code uses Prim's algorithm for determining a
minimum spanning tree in a flattened linear conflict space.  This
algorithm is also in excess of 40 years old.


And you thought that computer science was an art, not a scinece... 8-).


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802161355.GAA08438>