comp.lang.ada
 help / color / mirror / Atom feed
From: wtwolfe@hubcap.clemson.edu (Bill Wolfe)
Subject: Teaching Concurrency
Date: 7 Jan 90 02:26:35 GMT	[thread overview]
Message-ID: <7588@hubcap.clemson.edu> (raw)


   Some excerpts from an interesting article on the teaching of
   concurrency which can be found on pages 40-41 of ACM SIGAda
   Ada Letters, Volume VII, #5, Sep/Oct 1987 ("Experiences Teaching 
   Concurrency In Ada", Ronald J. Leach):

      The students were each assigned a project for which they 
      were required to write two Ada programs which involved at
      least two tasks.  In general, the tasks involved some simple
      idea that the students were very familiar with, at least in
      the case of sequential programs.  Thus, the difficulty was
      in understanding the concurrency and not in the computation
      performed by the individual task.  As an example, one student
      was asked to write a program with two tasks -- sort an array
      of integers and then search for a key using a binary search.
      The student was allowed to use any sorting algorithm.  Thus
      the student did not have difficulty implementing the individual
      algorithms for the tasks.  The troublesome part was the
      implementation of the synchronization or communication of the tasks.

      [...] Students were required to run their programs four times with
      the same input.  Most of the errors in the programs due to subtle
      assumptions about tasking made by the programmer became apparent
      after four runs.  Students' observations on this point were
      interesting.  In spite of several lectures on timing and
      synchronization of tasks, lengthy discussions on the nature of
      an Ada "logical processor", and numerous examples, students did
      not believe that programs could give different results or bomb
      when given the same input.  The sudden shock when THEIR program
      showed this behavior put the point across better than any lecture
      could.  Many of the students indicated that they had seen this kind
      of error at some time during program development.  Two of the students
      were so shocked by the different behavior of the sample runs that they
      turned in their projects with signatures of witnesses that their
      programs ran successfully at least once.  [...]
 
      ------ Other examples given of concurrent programming exercises ------

      1. Write a program which uses two tasks to solve quadratic equations
         using the quadratic formula.  Each task must perform at least 3
         arithmetic operations.

      2. Write a program to read an integer N and to have two tasks.  The
         tasks are to compute some simple function f(N) and to find all
         primes less than f(N).

      3. Write a program to simulate the donning of socks and shoes.  
         Putting on socks and putting on shoes are to be separate tasks.

      4. Write a program to read an array A of integers and to have two 
         tasks.  The tasks are to sort the array A in increasing order,
         passing this sorted array to B, and to sort the array B in 
         decreasing order.

             reply	other threads:[~1990-01-07  2:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-01-07  2:26 Bill Wolfe [this message]
1990-01-09 16:41 ` Teaching Concurrency 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
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