Problem Solving In Computer Science
Problem Solving in Computer Science
Scribe notes by Salman Mirghasemi
06.11.2008
1
BDD Operations
Suppose that b0 and b1 are the two BDDs shown in figure 1.
Figure 1: Two binary decision diagrams b0 and b1
b0 = (¬xi ∧ b00) ∨ (xi ∧ b01)
b1 = (¬xj ∧ b10) ∨ (xj ∧ b11)
1. Conjunction
i < j : b0 ∧ b1 = (¬xi ∧ (b00 ∧ b1)) ∨ (xi ∧ (b01 ∧ b1))
i = j : b0 ∧ b1 = (¬xi ∧ (b00 ∧ b10)) ∨ (xi ∧ (b01 ∧ b11))
2. Disjunction
i < j : b0 ∨ b1 = (¬xi ∧ (b00 ∨ b1)) ∨ (xi ∧ (b01 ∨ b1))
i = j : b0 ∨ b1 = (¬xi ∧ (b00 ∨ b10)) ∨ (xi ∧ (b01 ∨ b11))
3. Negation
¬b0 = (¬xi ∧ ¬b00) ∨ (xi ∧ ¬b01)
2
Concurret BDD computation
The BDD pool is in the shared memory and concurrent threads make a stream of MakeBDD calls to that
shared structure.
1
T1
T2
T3
MakeBDD(b11)
MakeBDD(b21)
MakeBDD(b13)
MakeBDD(b12)
MakeBDD(b13)
MakeBDD(b22)
.
.
.
.
.
.
.
.
.
In concurrent operations two properties should be considered : safety and liveness.
1. Safety
No call to MakeBDD returns a ”wrong” answer.
Linearizability: There is a sequential interleaving of all makeBDD calls such that the return values
of all concurrent calls are exactly those that would be obtained from sequentially executing all calls in
the order of the interleavings.
2. Liveness
Wait Freedom: Each method call return within a finite number of steps.
Lock Freedom: There is always some method call that returns in linear number of steps ( guarantees
overall progress but not progress on each thread).
A good synchronization solution locks as little data and as short time is possible.
You can find examples for Course-Grained and Fine-Grained synchronization in this book : ”The Art of
Multiprocessor Programming, Written by H.Maurice and N.Shavit”.
2