comp.lang.ada
 help / color / mirror / Atom feed
* ANNOUNCE: dining philosophers article posted to ACM archives
@ 1999-04-12  0:00 Matthew Heaney
  0 siblings, 0 replies; only message in thread
From: Matthew Heaney @ 1999-04-12  0:00 UTC (permalink / raw)


I have posted the article "Dining Philosophers" to the April 1999 ACM
patterns archive.

<http://www.acm.org/archives/patterns.html>
<mailto:patterns@acm.org>

Instructions for subscribing to the ACM patterns list appear at the end
of this message.

Here is an excerpt from the article:

Dining Philosophers

In this article we solve the dining philosophers problem, a classic
example used to illustrate resource allocation issues.  It features a
few different patterns implemented using myriad Ada features, including
counting semaphores, monitors, tasks, singletons, observers, and
procedure pointers.

There are five philosophers who do nothing but eat and think.  When a
philosopher wants to eat, she sits at a table with five places.  Between
each place is a chopstick that each philosopher shares with her
neighbor.

A chopstick can only be used by one philosopher at a time.  Before she
can eat, a philosopher must pick up both her left and right chopsticks.
If her neighbor has already picked up a chopstick, she must wait for her
neighbor to put it down, and then try to pick it up again.

We want to monitor the progress of philosophers, so each philosopher
reports state-changes to an observer, who displays the new state.  

The code provided is loosely based on the example in Chapter 6 of
Concurrency In Ada, by Alan Burns and Andy Wellings, and on the example
that comes with the GNAT sources, written by Michael B. Feldman.


About the ACM Patterns Mailing List

I have translated every C++ example in the GoF Design Patterns book to
Ada95, and have now started documenting idioms for concurrency,
real-time programming, and interprocess communication.

You can subscribe to the ACM patterns list by sending the message (body)

subscribe patterns <your full name>

to the ACM mailing list server.

<mailto:listserv@acm.org>


Matt




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-04-12  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-12  0:00 ANNOUNCE: dining philosophers article posted to ACM archives Matthew Heaney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox