CS 49/149: Concurrent Algorithms
Spring 2013
Homework 1 Solutions
Prepared by Prasad Jayanti
Problem 1
When discussing the Coordinated Attack problem in class, we considered two dierent validity
conditions:
Strong Validity : If the initial proposals of b
Algorithms
CS 49/149, Spring 2013
Homework 2, Part 2 Solutions
Prepared by Prasad Jayanti
Problem 2
When this course was taught a few years ago, two students (Vibhor and Scout) proposed the
following algorithm, which transforms any starvation-free mutex a
CS 49/149: Concurrent Algorithms
Spring 2013
Homework 6 Solutions
Prepared by Prasad Jayanti
1. Prove that, for all n > 2, 2-tolerant n-process binary consensus is not solvable using only
objects that support the three operationsread, write, and fetch&add
Concurrent Algorithms
CS 49/149, Spring 2013
Homework 7 Solutions
Prepared by Prasad Jayanti
Problems
1. In class I explained the essential idea behind how nodes are reused in Herlihys universal construction. To
remind you, each process owns a pool of nod
Concurrent Algorithms
CS 49/149, Spring 2013
Homework 5
Due: Problem 1 on May 10 and Problem 2 on May 14
Problems
1. You know that it was not easy to rigorously capture our intuitive sense of fairness. You saw how Lamport
managed a nice denition for fairn
Concurrent Algorithms
CS 49/149, Spring 2013
Homework 5 Solutions
Prepared by Prasad Jayanti
Problems
1. You know that it was not easy to rigorously capture our intuitive sense of fairness. You saw how Lamport
managed a nice denition for fairness through
Algorithms
CS 49/149, Spring 2013
Homework 4 Solutions
Prepared by Prasad Jayanti
Problems
1. Andersons n-process mutual exclusion algorithm, which uses fetch&add, has O(1) RMR
complexity on CC machines, but not on NUMA machines. Design a new algorithm th
Concurrent Algorithms
CS 49/149, Spring 2013
Homework 3 Solution
Prepared by Prasad Jayanti
Problem
1. In class I showed you an n-process mutual exclusion algorithm, which uses fetch&add and achieves O(1)
RMR complexity on CC machines. This algorithm uses
CS 49/149: Concurrent Algorithms
Spring 2013
Solution for Homework 2, Part 1
Prepared by Prasad Jayanti
Problem 1
In this problem, we generalize the ideas proposed in Petersons 2-process mutex algorithm to
design Petersons n-process algorithm, for any nat
CS 49/149: Concurrent Algorithms
Spring 2013
Final Exam Solutions
Prepared by Prasad Jayanti
Problems
1. Let us dene a new object called 3-bit array whose state is described by three bits B1 , B2 , B3 . The
operations supported by this object and their se