From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Xref: utzoo comp.edu:2885 comp.lang.ada:3150 comp.lang.misc:3854 Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!think!paperboy!meissner From: meissner@osf.org (Michael Meissner) Newsgroups: comp.edu,comp.lang.ada,comp.lang.misc Subject: Re: Teaching Concurrency Message-ID: Date: 11 Jan 90 16:09:15 GMT References: <7588@hubcap.clemson.edu> <602@agcsun.UUCP> <10330@june.cs.washington.edu> Sender: news@OSF.ORG Organization: Open Software Foundation In-reply-to: pattis@cs.washington.edu's message of 10 Jan 90 22:47:53 GMT List-Id: 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