comp.lang.ada
 help / color / mirror / Atom feed
From: meissner@osf.org (Michael Meissner)
Subject: Re: Teaching Concurrency
Date: 11 Jan 90 16:09:15 GMT	[thread overview]
Message-ID: <MEISSNER.90Jan11110915@pmax27.osf.org> (raw)
In-Reply-To: pattis@cs.washington.edu's message of 10 Jan 90 22:47:53 GMT

In article <10330@june.cs.washington.edu> pattis@cs.washington.edu (Richard Pattis) writes:

| OK, so this begs the question: what is the "smallest" assignment that can
| use concurrency fruitfully. I would like to teach a bit about tasking in
| one of my classes, but I don't want students to get "wrong" ideas from the
| example I use.  Anyone out there have such an assignment? Is there some prime
| example out there of a good use of multi-tasking that is amenable to
| classroom instruction?

When I was at Data General, and we wanted to convey how to use the
operating systems (RDOS, AOS, AOS/VS, but not unix) task facility, we
would use a cut down version of the tape archiver as an example.  In
the simplest case, you want to copy a file, overlapping the I and O
portions, you would then have a producer task and a consumer task, and
n buffers to use between the two, and then go on to the various
strategys of inter-task communication and buffer management.

The full blown tape archiver was a little bit more complicated (it had
tasks which did the equivalent of opendir, readdir, and closedir, and
fstat on the files, tasks which read in the files, and an output task
which ordered things appropriate, and wrote to the tape).  It took all
of the parallelism to make most tapes stream when doing a through the
filesystem backup.

Another fun multitasking example, was to use two tasks to write an
arcade-style game with terminal graphics (one task for terminal input,
and the other task for output).

Finally, there is the example of a multi-tasked server, or transaction
processing system, but that is perhaps too complicated for a classroom
setting.

The problem with a real world examples like the above is if your
operating system does not have real tasks (threads, etc.), and merely
simulates it, you don't get any benifits from tasking, and it is
better to write the stuff single threaded.

IMHO, I believe that the normal task examples like slowsort, or what
have you are not so useful in real world programming, and may in fact
encourage bad habits.

--
Michael Meissner	email: meissner@osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA

Catproof is an oxymoron, Childproof is nearly so

  parent reply	other threads:[~1990-01-11 16:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-01-07  2:26 Teaching Concurrency Bill Wolfe
1990-01-09 16:41 ` Marc Benveniste,lsp
1990-01-10 20:49 ` Mark Shepherd
1990-01-10 22:47   ` Richard Pattis
1990-01-11 13:04     ` Robert Firth
1990-01-11 19:27       ` Vincent Manis
1990-01-13  7:34         ` Peter G Ludemann
1990-01-12 19:02       ` Peter da Silva
1990-01-15 13:30         ` Robert Firth
1990-01-17 15:40         ` Kurt Luoto
1990-01-11 16:09     ` Michael Meissner [this message]
1990-01-14 12:33       ` Re^2: " Kim Shearer
1990-01-11 18:50     ` Tom Griest
1990-01-11 20:38     ` Brian L. Stuart
1990-01-12  0:47     ` Robert Steigerwald x2468
1990-01-15 11:10     ` Stavros Macrakis
1990-01-11 14:52   ` David Lamb
1990-01-13  0:06     ` Mark Shepherd
1990-01-11 16:13   ` S. Crispin Cowan
1990-01-12 13:12     ` Mike Harrison
1990-01-11 19:20   ` Vincent Manis
replies disabled

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