The Little Book of Semaphores

by Allen Downey

DescriptionTable of ContentsDetailsHashtagsReport an issue

Book Description

The Little Book of Semaphores is a free textbook that introduces the principles of synchronization for concurrent programming.

In most computer science curricula, synchronization is a module in an Operating Systems class. OS textbooks present a standard set of problems with a standard set of solutions, but most students don't get a good understanding of the material or the ability to solve similar problems.

The approach of this book is to identify patterns that are useful for a variety of synchronization problems and then show how they can be assembled into solutions. After each problem, the book offers a hint before showing a solution, giving students a better chance of discovering solutions on their own.

The book covers the classical problems, including "Readers-writers," "Producer-consumer", and "Dining Philosophers." In addition, it collects a number of not-so-classical problems, some written by the author and some by other teachers and textbook writers. Readers are invited to create and submit new problems.

This open book is licensed under a Creative Commons License (CC BY-NC-SA). You can download The Little Book of Semaphores ebook for free in PDF format (1.2 MB).

Table of Contents

Chapter 1
Chapter 2
Chapter 3
Basic synchronization patterns
Chapter 4
Classical synchronization problems
Chapter 5
Less classical synchronization problems
Chapter 6
Not-so-classical problems
Chapter 7
Not remotely classical problems
Chapter 8
Synchronization in Python
Chapter 9
Synchronization in C
Appendix A
Cleaning up Python threads
Appendix B
Cleaning up POSIX threads

Book Details

Computer Science
Green Tea Press
PDF Size
1.2 MB

Book Hashtags

Related Books

The Academic Book of the Future
Part of the AHRC/British Library Academic Book of the Future Project, this book interrogates current and emerging contexts of academic books from the perspectives of thirteen expert voices from the connected communities of publishing, academia, libraries, and bookselling....
Science as Social Existence
In this bold and original study, Jeff Kochan constructively combines the sociology of scientific knowledge (SSK) with Martin Heidegger's early existential conception of science. Kochan shows convincingly that these apparently quite different approaches to science are, in fact, largely compatible, even mutually reinforcing. By combining Heidegger...
The Condition of Digitality
David Harvey's The Condition of Postmodernity rationalised capitalism's transformation during an extraordinary year: 1989. It gave theoretical expression to a material and cultural reality that was just then getting properly started - globalisation and postmodernity - whilst highlighting the geo-spatial limits to accumulation imposed by our planet....
The Everyday Life of an Algorithm
This book begins with an algorithm - a set of IF...THEN rules used in the development of a new, ethical, video surveillance architecture for transport hubs. Readers are invited to follow the algorithm over three years, charting its everyday life. Questions of ethics, transparency, accountability and market value must be grasped by the algorithm in ...
The little book about OS development
The OS kernel and this book were produced as part of an advanced individual course at the Royal Institute of Technology, Stockholm. The authors had previously taken courses in OS theory, but had only minor practical experience with OS kernel development. In order to get more insight and a deeper understanding of how the theory from the previous OS ...
The DSC Book
Learn everything you need to know about Microsoft's Desired State Configuration, a management platform in Windows PowerShell. The DSC Book is designed to help you understand how DSC works, and how you can use it in a variety of scenarios....