June 22, 2008
June 22, 2008
June 25, 2008
Electrical and Computer
13.174.1 - 13.174.7
An Argument and Example for the Early Introduction of Threads
Teaching concurrency to undergraduates has always been a challenge, partly because actual experience with multiprocessor machines has not always been easy to arrange. We are now moving into a time when such machines will be the rule rather than the exception, but teaching concurrency is still difficult. Most of the principles used in designing for concurrent execution have traditionally been taught in the operating systems class, a class which is normally not encountered until fairly late in a student’s academic career. This paper argues that students need exposure to concurrency much earlier and that those topics should be covered in the core courses so that students obtain early, positive experience with threaded applications. A particular design for a set of assignments is presented, using Mandelbrot iteration1 because it is a compute-bound application for which students can see remarkable speedup and because the end result is an attractive, highly motivating piece of software that students can get excited about.
Many courses taught in Computer Science (CS) and Computer Engineering (CE) on the undergraduate level must deal with issues of concurrency. Any course which requires students to produce graphical user interfaces would do well to place that topic in the context of threading, for the simple reason that some event responses initiate heavy computations. If the user interface becomes frozen because of a menu choice or some other user manipulation, the user’s satisfaction level plummets. If the computations so initiated are made to take place in a separate thread, then the interface itself remains responsive.
Another place where concurrency is extremely valuable is in a computer gaming course, where the graphics are animated and involve entities on the screen that appear to be acting independently and simultaneously. The most natural way to achieve this effect is with separate threads. However, if students have not mastered threading before they enter this type of course there will need to be a major effort devoted to their accommodating this topic on the front end of the course.
Much accommodation must be made by the student before he or she can be said to be proficient with threading. Ultimately the student must deal with some tricky and difficult issues to achieve proper synchronization and communication, but early in the study of the topic it is useful and appropriate to shield the student from such issues and give time for mastering the mechanics of dividing up a problem and consolidating the results produced by multiple threads.
Making room in the core of the CS or CE major for a solid introduction to threading will make it much more natural to discuss the more difficult issues involved as they occur in advanced
ASEE holds the copyright on this document. It may be read by the public free of charge. Authors may archive their work on personal websites or in institutional repositories with the following citation: © 2008 American Society for Engineering Education. Other scholars may excerpt or quote from these materials with the same citation. When excerpting or quoting from Conference Proceedings, authors should, in addition to noting the ASEE copyright, list all the original authors and their institutions and name the host city of the conference. - Last updated April 1, 2015