database - Why is the tree protocol deadlock free? -
i have been reading tree protocol approach in locking management in databases. read deadlock free not sure how works.
example:

assume t1 has locked b, d, e in exclusive mode.
according rules:
t2 can lock h (allowed rule 2).
if t1 wants lock h can not despite fact has locked parent d since t2 has lock waits.
if t2 wants lock g has lock d d locked t1 has wait. hence deadlock.
misunderstanding in algorithm?
in example, rule 2 of tree protocol not allow t2 request lock on g, there cannot deadlock.
the first item locked t2 h. rule 2, t2 can request locks descendants of h (j in example).
if t2 needs lock on both h , g, first lock request must on parent d (or ancestor of both h , g).
Comments
Post a Comment