Title: Class 21: Bakers and Philosophers
Date: 2014-04-15
Category: Classes
Tags: operating systems, kernel, kernel programming, synchronization, Dijkstra, Lamport, mutual exclusion
Author: David Evans

   <div class="todo"> 
   <center>

**Project Design Meetings** are this week.  Your team should come to the
  design meeting prepared to explain what you are doing for your project
  and why, what you have done so far, your plan for finishing, and any
  questions you have.

Your team should submit a [**Project Submission
Option**](https://docs.google.com/forms/d/1yECpbvJLWqelIRrLPwgioA1G8Eb4nsaa3TgzW_qr-Uw/viewform)
by Monday, 21 April (4:59pm).  But, the earlier you submit the more
likely you are to receive your first choice.


   </center>
   </div>

<center>
<iframe src="http://www.slideshare.net/slideshow/embed_code/33565511" width="476" height="400" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</center>

# Readings

The [recommended text](http://pages.cs.wisc.edu/~remzi/OSTEP/) has a full chapter on Concurrency, including:

[Concurrency and Threads](http://pages.cs.wisc.edu/~remzi/OSTEP/threads-intro.pdf)  
[Thread API](http://pages.cs.wisc.edu/~remzi/OSTEP/threads-api.pdf)  
[Locks](http://pages.cs.wisc.edu/~remzi/OSTEP/threads-locks.pdf)  
[Lock-based Concurrent Data Structures](http://pages.cs.wisc.edu/~remzi/OSTEP/threads-locks-usage.pdf)  
[Condition Variables](http://pages.cs.wisc.edu/~remzi/OSTEP/threads-cv.pdf)  
[Semaphores](http://pages.cs.wisc.edu/~remzi/OSTEP/threads-sema.pdf)  
[Common Concurrency Problems](http://pages.cs.wisc.edu/~remzi/OSTEP/threads-bugs.pdf)  
[Event-based Concurrency](http://pages.cs.wisc.edu/~remzi/OSTEP/threads-events.pdf)

These sections cover some of the topics we covered in class, as well as
many other relevant and interesting topics.  Because they use C with the
pthread library, some of the specifics are quite different from Rust
programming but the main ideas are the same (and Sarah and Robert are
working on rewriting some of them for their project).

The main topic of the next class will be OS design focusing on
microkernels and beyond.  Much of the material will be based on this
paper: Kevin Elphinstone and Gernot Heiser, [_From L3 to seL4: What Have
We Learnt in 20 Years of L4
Microkernels?_](http://www.nicta.com.au/pub?doc=6930), SOSP 2013. 

# Mutual Exclusion

Why is it worthwhile to study mutual exclusion protocols?
<div class="gap">

</div>

Why is it a waste of time to study mutual exclusion protocols?
<div class="gap">

</div>

How hard it is to invent a protocol that provides mutual exclusion without liveness guarantees?
<div class="gap">

</div>

How does Dijkstra prove mutual exclusion?
<div class="gap">

</div>

What assumption does Lamport's solution give up that Dijkstra's solution relies on?
<div class="gap">

</div>



<div id="disqus_thread"></div>

<script type="text/javascript">
        /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
        var disqus_shortname = 'rust-class'; // required: replace example with your forum shortname
	var disqus_url = 'http://www.rust-class.org/class-21-bakers-and-philosophers.html';

        /* * * DON'T EDIT BELOW THIS LINE * * */
        (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
            dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
