Moving on from type systems, today’s lecture started a look at programming for concurrency: why you might want — or need — to write concurrent code and some of the challenges in doing so. I also introduced some of the concurrency primitives in Java and how they are used, as well as telling a story about the Apollo Guidance Computer and the robustness of its concurrent event handling under input overload.
Link: Slides for Lecture 7
Homework
Do this
Find out what a data race is. What happens to C or C++ code that contains a data race?
Read this
Work through the first three sections of the Java Concurrency Tutorial.
Look for other tutorials on Java concurrency — there are many. Post links for ones you like to the apl-students@inf.ed.ac.uk mailing list.
References
Quite a lot this time. I used the following pieces as sources for some of the images and ideas in the lecture slides.
- Herb Sutter. The Free Lunch is Over: A Fundamental Turn Towards Concurrency in Software. Dr Dobb’s Journal 30(3), March 2005. Revised 2009.
- Herb Sutter. Welcome to the Jungle. Sutter’s Mill (blog), 2012.
The first article identified the impact of hardware trends on the need for concurrent programming; the follow-up a few years later goes into great detail on just how extensive that is and the wide range of concurrency that’s involved.
- John Ousterhout. Why Threads are a Bad Idea (for most purposes). Invited talk at USENIX 1996 Technical Conference, January 1996.
- Rob von Behren, Jeremy Condit and Eric Brewer. Why Events Are A Bad Idea (for high-concurrency servers). Paper at HotOS IX: The 9th Workshop on Hot Topics in Operating Systems, May 2003.
These contrasting talks argue for and against threads or events being a good model for programming concurrent systems.
Margaret Hamilton is a software engineer who was lead developer for the Apollo flight software. The following fairly sedate NASA announcement and rather more effusive magazine articles describe some of her achievements in a lifetime of professional computing.
- NASA Honors Apollo Engineer. NASA, September 2003.
- Lily Rothman. Remembering the Apollo 11 Moon Landing With the Woman Who Made It Happen. TIME Magazine, July 2015.
- Dylan Matthews. Meet Margaret Hamilton, the badass ’60s programmer who saved the moon landing. Vox, July 2015.
- Robert McMillan. Her Code Got Humans on the Moon—And Invented Software Itself. Wired, October 2015.
Code for the Apollo Guidance Computer written by Hamilton’s team is now on GitHub.
- Keith Collins. The code that took America to the moon was just published to GitHub, and it’s like a 1960s time capsule. Quartz, July 2016.
You can also run it in a web page, a stand-alone emulator, or to fly a virtual spacecraft (some assembly required).
After the Women of NASA proposal reached 10k votes in two weeks earlier this year, LEGO have passed it to their official Review Board and in due course may be making that Margaret Hamilton minifig.
![]() |
![]() |