comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: ANNOUNCE: dining philosophers article posted to ACM archives
Date: 1999/04/12
Date: 1999-04-12T00:00:00+00:00	[thread overview]
Message-ID: <m3soa6uuoh.fsf@mheaney.ni.net> (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




                 reply	other threads:[~1999-04-12  0:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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